Browse Source

Move Middleware to Jellyfin.Api

Patrick Barron 2 years ago
parent
commit
74a07f6d1c

+ 1 - 1
Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs → Jellyfin.Api/Middleware/BaseUrlRedirectionMiddleware.cs

@@ -7,7 +7,7 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
 using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Redirect requests without baseurl prefix to the baseurl prefixed URL.

+ 1 - 1
Jellyfin.Server/Middleware/ExceptionMiddleware.cs → Jellyfin.Api/Middleware/ExceptionMiddleware.cs

@@ -12,7 +12,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Exception Middleware.

+ 1 - 1
Jellyfin.Server/Middleware/IpBasedAccessValidationMiddleware.cs → Jellyfin.Api/Middleware/IpBasedAccessValidationMiddleware.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Common.Extensions;
 using MediaBrowser.Common.Net;
 using Microsoft.AspNetCore.Http;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Validates the IP of requests coming from local networks wrt. remote access.

+ 1 - 1
Jellyfin.Server/Middleware/LanFilteringMiddleware.cs → Jellyfin.Api/Middleware/LanFilteringMiddleware.cs

@@ -5,7 +5,7 @@ using MediaBrowser.Common.Net;
 using MediaBrowser.Controller.Configuration;
 using Microsoft.AspNetCore.Http;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Validates the LAN host IP based on application configuration.

+ 1 - 1
Jellyfin.Server/Middleware/LegacyEmbyRouteRewriteMiddleware.cs → Jellyfin.Api/Middleware/LegacyEmbyRouteRewriteMiddleware.cs

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Logging;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Removes /emby and /mediabrowser from requested route.

+ 1 - 1
Jellyfin.Server/Middleware/QueryStringDecodingMiddleware.cs → Jellyfin.Api/Middleware/QueryStringDecodingMiddleware.cs

@@ -2,7 +2,7 @@ using System.Threading.Tasks;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Features;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// URL decodes the querystring before binding.

+ 1 - 1
Jellyfin.Server/Middleware/ResponseTimeMiddleware.cs → Jellyfin.Api/Middleware/ResponseTimeMiddleware.cs

@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Extensions;
 using Microsoft.Extensions.Logging;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Response time middleware.

+ 1 - 1
Jellyfin.Server/Middleware/RobotsRedirectionMiddleware.cs → Jellyfin.Api/Middleware/RobotsRedirectionMiddleware.cs

@@ -3,7 +3,7 @@ using System.Threading.Tasks;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Logging;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Redirect requests to robots.txt to web/robots.txt.

+ 1 - 1
Jellyfin.Server/Middleware/ServerStartupMessageMiddleware.cs → Jellyfin.Api/Middleware/ServerStartupMessageMiddleware.cs

@@ -5,7 +5,7 @@ using MediaBrowser.Controller;
 using MediaBrowser.Model.Globalization;
 using Microsoft.AspNetCore.Http;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Shows a custom message during server startup.

+ 1 - 1
Jellyfin.Server/Middleware/UrlDecodeQueryFeature.cs → Jellyfin.Api/Middleware/UrlDecodeQueryFeature.cs

@@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.Extensions.Primitives;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Defines the <see cref="UrlDecodeQueryFeature"/>.

+ 1 - 1
Jellyfin.Server/Middleware/WebSocketHandlerMiddleware.cs → Jellyfin.Api/Middleware/WebSocketHandlerMiddleware.cs

@@ -2,7 +2,7 @@ using System.Threading.Tasks;
 using MediaBrowser.Controller.Net;
 using Microsoft.AspNetCore.Http;
 
-namespace Jellyfin.Server.Middleware
+namespace Jellyfin.Api.Middleware
 {
     /// <summary>
     /// Handles WebSocket requests.

+ 1 - 1
Jellyfin.Server/Extensions/ApiApplicationBuilderExtensions.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
+using Jellyfin.Api.Middleware;
 using Jellyfin.Networking.Configuration;
-using Jellyfin.Server.Middleware;
 using MediaBrowser.Controller.Configuration;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.OpenApi.Models;

+ 1 - 1
Jellyfin.Server/Startup.cs

@@ -5,6 +5,7 @@ using System.Net.Http;
 using System.Net.Http.Headers;
 using System.Net.Mime;
 using System.Text;
+using Jellyfin.Api.Middleware;
 using Jellyfin.MediaEncoding.Hls.Extensions;
 using Jellyfin.Networking.Configuration;
 using Jellyfin.Server.Extensions;
@@ -12,7 +13,6 @@ using Jellyfin.Server.HealthChecks;
 using Jellyfin.Server.Implementations;
 using Jellyfin.Server.Implementations.Extensions;
 using Jellyfin.Server.Infrastructure;
-using Jellyfin.Server.Middleware;
 using MediaBrowser.Common.Net;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller.Configuration;

+ 1 - 1
tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 using System.Linq;
-using Jellyfin.Server.Middleware;
+using Jellyfin.Api.Middleware;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Features;
 using Microsoft.Extensions.Primitives;