From 39074b0b1d040969f86d787c2346d5ed5a9f72dc Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 4 Oct 2024 19:19:12 -0700 Subject: [PATCH] New: Use 307 redirect for requests missing URL Base Closes #7262 --- src/Sonarr.Http/Middleware/UrlBaseMiddleware.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Sonarr.Http/Middleware/UrlBaseMiddleware.cs b/src/Sonarr.Http/Middleware/UrlBaseMiddleware.cs index 9f85731d2..3b17c10d2 100644 --- a/src/Sonarr.Http/Middleware/UrlBaseMiddleware.cs +++ b/src/Sonarr.Http/Middleware/UrlBaseMiddleware.cs @@ -20,6 +20,8 @@ namespace Sonarr.Http.Middleware if (_urlBase.IsNotNullOrWhiteSpace() && context.Request.PathBase.Value.IsNullOrWhiteSpace()) { context.Response.Redirect($"{_urlBase}{context.Request.Path}{context.Request.QueryString}"); + context.Response.StatusCode = 307; + return; }