mirror of
https://github.com/gin-gonic/gin.git
synced 2026-12-02 00:53:38 +08:00
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:
parent
09b561866f
commit
5793a439a5
@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user