mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
update portable projects
This commit is contained in:
27
ServiceStack/HttpHandlerFactory.cs
Normal file
27
ServiceStack/HttpHandlerFactory.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Services;
|
||||
using ServiceStack.Host;
|
||||
|
||||
namespace ServiceStack
|
||||
{
|
||||
public class HttpHandlerFactory
|
||||
{
|
||||
// Entry point for HttpListener
|
||||
public static RestHandler GetHandler(IHttpRequest httpReq)
|
||||
{
|
||||
var pathInfo = httpReq.PathInfo;
|
||||
|
||||
var pathParts = pathInfo.TrimStart('/').Split('/');
|
||||
if (pathParts.Length == 0) return null;
|
||||
|
||||
string contentType;
|
||||
var restPath = RestHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out contentType);
|
||||
if (restPath != null)
|
||||
return new RestHandler { RestPath = restPath, RequestName = restPath.RequestType.GetOperationName(), ResponseContentType = contentType };
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user