Skip to content

Commit 406d2fa

Browse files
minuxbradfitz
authored andcommitted
net/http: fix test TestServeMuxHandlerRedirects
The code was intended to test that mux handler should redirect at most once, but the added loop condition defeated that. Remove the loop condition and document the intention better. Fixes #18068. Change-Id: I2a4ea041eae27168b45a09aa46e740ac03921594 Reviewed-on: https://go-review.googlesource.com/33654 TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]>
1 parent a745dc9 commit 406d2fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/net/http/serve_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ func TestServeMuxHandlerRedirects(t *testing.T) {
400400
}
401401

402402
for _, tt := range serveMuxTests2 {
403-
tries := 1
403+
tries := 1 // expect at most 1 redirection if redirOk is true.
404404
turl := tt.url
405-
for tries > 0 {
405+
for {
406406
u, e := url.Parse(turl)
407407
if e != nil {
408408
t.Fatal(e)

0 commit comments

Comments
 (0)