mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 00:55:13 +01:00
Merge pull request #4043 from cvium/remove_shit_and_shit_adjacent_shit
Split HttpListenerHost into middlewares
This commit is contained in:
@@ -8,6 +8,12 @@ namespace MediaBrowser.Controller.Extensions
|
||||
/// </summary>
|
||||
public static class ConfigurationExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// The key for a setting that specifies the default redirect path
|
||||
/// to use for requests where the URL base prefix is invalid or missing..
|
||||
/// </summary>
|
||||
public const string DefaultRedirectKey = "DefaultRedirectPath";
|
||||
|
||||
/// <summary>
|
||||
/// The key for a setting that indicates whether the application should host web client content.
|
||||
/// </summary>
|
||||
|
||||
@@ -20,6 +20,8 @@ namespace MediaBrowser.Controller
|
||||
|
||||
IServiceProvider ServiceProvider { get; }
|
||||
|
||||
bool CoreStartupHasCompleted { get; }
|
||||
|
||||
bool CanLaunchWebBrowser { get; }
|
||||
|
||||
/// <summary>
|
||||
@@ -117,8 +119,7 @@ namespace MediaBrowser.Controller
|
||||
IEnumerable<WakeOnLanInfo> GetWakeOnLanInfo();
|
||||
|
||||
string ExpandVirtualPath(string path);
|
||||
string ReverseVirtualPath(string path);
|
||||
|
||||
Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next);
|
||||
string ReverseVirtualPath(string path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Events;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IHttpServer.
|
||||
/// </summary>
|
||||
public interface IHttpServer
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the URL prefix.
|
||||
/// </summary>
|
||||
/// <value>The URL prefix.</value>
|
||||
string[] UrlPrefixes { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [web socket connected].
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<IWebSocketConnection>> WebSocketConnected;
|
||||
|
||||
/// <summary>
|
||||
/// Inits this instance.
|
||||
/// </summary>
|
||||
void Init(IEnumerable<IWebSocketListener> listener, IEnumerable<string> urlPrefixes);
|
||||
|
||||
/// <summary>
|
||||
/// If set, all requests will respond with this message.
|
||||
/// </summary>
|
||||
string GlobalResponse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The HTTP request handler.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
Task RequestHandler(HttpContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Get the default CORS headers.
|
||||
/// </summary>
|
||||
/// <param name="httpContext">The HTTP context of the current request.</param>
|
||||
/// <returns>The default CORS headers for the context.</returns>
|
||||
IDictionary<string, string> GetDefaultCorsHeaders(HttpContext httpContext);
|
||||
}
|
||||
}
|
||||
32
MediaBrowser.Controller/Net/IWebSocketManager.cs
Normal file
32
MediaBrowser.Controller/Net/IWebSocketManager.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Events;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IHttpServer.
|
||||
/// </summary>
|
||||
public interface IWebSocketManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [web socket connected].
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<IWebSocketConnection>> WebSocketConnected;
|
||||
|
||||
/// <summary>
|
||||
/// Inits this instance.
|
||||
/// </summary>
|
||||
/// <param name="listeners">The websocket listeners.</param>
|
||||
void Init(IEnumerable<IWebSocketListener> listeners);
|
||||
|
||||
/// <summary>
|
||||
/// The HTTP request handler.
|
||||
/// </summary>
|
||||
/// <param name="context">The current HTTP context.</param>
|
||||
/// <returns>The task.</returns>
|
||||
Task WebSocketRequestHandler(HttpContext context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user