Switched to MEF to register http handlers

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-08 10:52:13 -04:00
parent a95e868300
commit 93b42641d2
26 changed files with 240 additions and 154 deletions

View File

@@ -1,12 +1,20 @@
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.Entities;
using System.ComponentModel.Composition;
using System.Net;
using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
[Export(typeof(BaseHandler))]
class UserAuthenticationHandler : BaseSerializationHandler<AuthenticationResult>
{
public override bool HandlesRequest(HttpListenerRequest request)
{
return ApiService.IsApiUrlMatch("UserAuthentication", request);
}
protected override async Task<AuthenticationResult> GetObjectToSerialize()
{
string userId = await GetFormValue("userid").ConfigureAwait(false);