Skip to content

Commit

Permalink
net/http: fix test TestServeMuxHandlerRedirects
Browse files Browse the repository at this point in the history
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 golang#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]>
  • Loading branch information
minux authored and bradfitz committed Nov 30, 2016
1 parent a745dc9 commit 406d2fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net/http/serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 406d2fa

Please sign in to comment.