diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-17 23:00:37 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-17 23:00:37 -0400 |
| commit | c58d4a4b2ecb967337b881974da0a6ed235bd53a (patch) | |
| tree | 15bc69aea29d1814f80983ef57b9ba93bc29f469 /MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | a55449628b2e0376fdc8100cb3c804c50b0e8547 (diff) | |
update chromecast
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 044ed25f9..79638d751 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -83,12 +83,21 @@ namespace MediaBrowser.Server.Implementations.HttpServer container.Adapter = _containerAdapter; Plugins.Add(new SwaggerFeature()); - Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, Authorization")); + Plugins.Add(new CorsFeature(allowedHeaders: "Content-Type, Authorization, X-MediaBrowser-Token")); //Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { // new SessionAuthProvider(_containerAdapter.Resolve<ISessionContext>()), //})); + PreRequestFilters.Add((httpReq, httpRes) => + { + //Handles Request and closes Responses after emitting global HTTP Headers + if (string.Equals(httpReq.Verb, "OPTIONS", StringComparison.OrdinalIgnoreCase)) + { + httpRes.EndRequest(); //add a 'using ServiceStack;' + } + }); + HostContext.GlobalResponseFilters.Add(new ResponseFilter(_logger).FilterResponse); } |
