From b3f8b483dbc532bbc83f6ccc8f5345a1dfe336e4 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 24 Jan 2024 09:51:13 -0500 Subject: [PATCH] Revert "debug: revert prefix hack" This reverts commit 9002064937ae0f869af09964c5c72694cd10f97f. --- api/middleware/s5.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/middleware/s5.go b/api/middleware/s5.go index 3b5328f..887526a 100644 --- a/api/middleware/s5.go +++ b/api/middleware/s5.go @@ -139,12 +139,12 @@ func replacePrefix(prefix string, h http.Handler) http.Handler { p := strings.TrimPrefix(r.URL.Path, prefix) rp := strings.TrimPrefix(r.URL.RawPath, prefix) if len(p) < len(r.URL.Path) && (r.URL.RawPath == "" || len(rp) < len(r.URL.RawPath)) { - /* if len(p) == 0 { - p = "/" - } - if len(rp) == 0 { - rp = "/" - }*/ + if len(p) == 0 { + p = "/" + } + if len(rp) == 0 { + rp = "/" + } r2 := new(http.Request) *r2 = *r r2.URL = new(url.URL)