From 59bfad7614dec17b8907d02a31deaa3604e55140 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/Prowlarr.Http/Middleware/UrlBaseMiddleware.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Prowlarr.Http/Middleware/UrlBaseMiddleware.cs b/src/Prowlarr.Http/Middleware/UrlBaseMiddleware.cs index 4cd37c24e..cf7e7b5cf 100644 --- a/src/Prowlarr.Http/Middleware/UrlBaseMiddleware.cs +++ b/src/Prowlarr.Http/Middleware/UrlBaseMiddleware.cs @@ -20,6 +20,8 @@ namespace Prowlarr.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; }