diff options
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpServer')
| -rw-r--r-- | MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Common.Implementations/HttpServer/HttpServer.cs | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs b/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs index 1c64194a6..bf487b760 100644 --- a/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs +++ b/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Extensions; +using System.Collections.Generic; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.IO; using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Net; @@ -451,5 +452,14 @@ namespace MediaBrowser.Common.Implementations.HttpServer Response.AddHeader("Age", Convert.ToInt64((DateTime.UtcNow - lastDateModified.Value).TotalSeconds).ToString(CultureInfo.InvariantCulture)); } } + + /// <summary> + /// Gets the routes. + /// </summary> + /// <returns>IEnumerable{RouteInfo}.</returns> + public IEnumerable<RouteInfo> GetRoutes() + { + return new RouteInfo[] {}; + } } } diff --git a/MediaBrowser.Common.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Common.Implementations/HttpServer/HttpServer.cs index c0f075c5a..785ca56c6 100644 --- a/MediaBrowser.Common.Implementations/HttpServer/HttpServer.cs +++ b/MediaBrowser.Common.Implementations/HttpServer/HttpServer.cs @@ -511,6 +511,11 @@ namespace MediaBrowser.Common.Implementations.HttpServer EndpointHost.ConfigureHost(this, ServerName, CreateServiceManager()); ContentTypeFilters.Register(ContentType.ProtoBuf, (reqCtx, res, stream) => ProtobufSerializer.SerializeToStream(res, stream), (type, stream) => ProtobufSerializer.DeserializeFromStream(stream, type)); + foreach (var route in services.SelectMany(i => i.GetRoutes())) + { + Routes.Add(route.RequestType, route.Path, route.Verbs); + } + Init(); } } |
