Added IHttpResultFactory
This commit is contained in:
parent
bf9f0bc534
commit
332f635939
|
@ -61,6 +61,7 @@
|
|||
<Compile Include="IO\StreamDefaults.cs" />
|
||||
<Compile Include="Net\BasePeriodicWebSocketListener.cs" />
|
||||
<Compile Include="Configuration\IApplicationPaths.cs" />
|
||||
<Compile Include="Net\IHttpResultFactory.cs" />
|
||||
<Compile Include="Net\IServerManager.cs" />
|
||||
<Compile Include="Net\IWebSocketListener.cs" />
|
||||
<Compile Include="IApplicationHost.cs" />
|
||||
|
|
9
MediaBrowser.Common/Net/IHttpResultFactory.cs
Normal file
9
MediaBrowser.Common/Net/IHttpResultFactory.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.Common.Net
|
||||
{
|
||||
public interface IHttpResultFactory
|
||||
{
|
||||
object GetResult(Stream stream, string contentType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using MediaBrowser.Common.Net;
|
||||
using ServiceStack.Common.Web;
|
||||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
{
|
||||
public class HttpResultFactory : IHttpResultFactory
|
||||
{
|
||||
public object GetResult(Stream stream, string contentType)
|
||||
{
|
||||
return new HttpResult(stream, contentType);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -106,6 +106,7 @@
|
|||
<Compile Include="BdInfo\BdInfoExaminer.cs" />
|
||||
<Compile Include="Configuration\ServerConfigurationManager.cs" />
|
||||
<Compile Include="HttpServer\BaseRestService.cs" />
|
||||
<Compile Include="HttpServer\HttpResultFactory.cs" />
|
||||
<Compile Include="HttpServer\HttpServer.cs" />
|
||||
<Compile Include="HttpServer\NativeWebSocket.cs" />
|
||||
<Compile Include="HttpServer\ServerFactory.cs" />
|
||||
|
|
|
@ -155,6 +155,8 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
await base.RegisterResources().ConfigureAwait(false);
|
||||
|
||||
RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory());
|
||||
|
||||
RegisterSingleInstance<IServerApplicationHost>(this);
|
||||
RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user