From f6542bab0a6c05760b4d926d9d87720ed136f38a 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 --- src/Radarr.Http/Middleware/UrlBaseMiddleware.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Radarr.Http/Middleware/UrlBaseMiddleware.cs b/src/Radarr.Http/Middleware/UrlBaseMiddleware.cs index 091f2aaeb..3f593851f 100644 --- a/src/Radarr.Http/Middleware/UrlBaseMiddleware.cs +++ b/src/Radarr.Http/Middleware/UrlBaseMiddleware.cs @@ -20,6 +20,8 @@ public async Task InvokeAsync(HttpContext context) if (_urlBase.IsNotNullOrWhiteSpace() && context.Request.PathBase.Value.IsNullOrWhiteSpace()) { context.Response.Redirect($"{_urlBase}{context.Request.Path}{context.Request.QueryString}"); + context.Response.StatusCode = 307; + return; }