修复重定向问题

This commit is contained in:
ExplodingDragon
2025-11-25 20:36:36 +08:00
parent 60e3c8e90c
commit c195f18229
3 changed files with 25 additions and 20 deletions

View File

@@ -94,6 +94,12 @@ func Test_fail_back(t *testing.T) {
server.AddFile("org1/org1.example.com/gh-pages/index.html", "hello world 1")
server.AddFile("org1/org1.example.com/gh-pages/child/index.html", "hello world 2")
server.AddFile("org1/child/gh-pages/no.html", "hello world 3")
_, resp, err := server.OpenFile("https://org1.example.com/child")
assert.NoError(t, err)
assert.Equal(t, 302, resp.StatusCode)
assert.Equal(t, "/child/", resp.Header.Get("Location"))
data, _, err := server.OpenFile("https://org1.example.com/child/")
assert.NoError(t, err)
assert.Equal(t, "hello world 2", string(data))