test(gin): cover X-Forwarded-Prefix in the escaped trailing slash redirect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
b84330808 2026-11-03 11:18:31 +09:00
parent 09b561866f
commit 5793a439a5

View File

@ -318,6 +318,10 @@ func TestRouteRedirectTrailingSlashKeepsEscapedPath(t *testing.T) {
w = PerformRequest(router, http.MethodGet, "/dirs/a%2Fb")
assert.Equal(t, http.StatusMovedPermanently, w.Code)
assert.Equal(t, "/dirs/a%2Fb/", w.Header().Get("Location"))
w = PerformRequest(router, http.MethodGet, "/files/a%2Fb/", header{Key: "X-Forwarded-Prefix", Value: "/api"})
assert.Equal(t, http.StatusMovedPermanently, w.Code)
assert.Equal(t, "/api/files/a%2Fb", w.Header().Get("Location"))
}
}