Commit 406d2fa2 authored by Shenghou Ma's avatar Shenghou Ma Committed by Brad Fitzpatrick

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 <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent a745dc93
......@@ -400,9 +400,9 @@ func TestServeMuxHandlerRedirects(t *testing.T) {
}
for _, tt := range serveMuxTests2 {
tries := 1
tries := 1 // expect at most 1 redirection if redirOk is true.
turl := tt.url
for tries > 0 {
for {
u, e := url.Parse(turl)
if e != nil {
t.Fatal(e)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment