Browse Source
report error on failed location response (#3184)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
master
Mark Sargent
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
0 deletions
-
caddytest/caddytest.go
|
@ -301,6 +301,10 @@ func AssertRedirect(t *testing.T, requestURI string, expectedToLocation string, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
loc, err := resp.Location() |
|
|
loc, err := resp.Location() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
t.Errorf("requesting \"%s\" expected location: \"%s\" but got error: %s", requestURI, expectedToLocation, err) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if expectedToLocation != loc.String() { |
|
|
if expectedToLocation != loc.String() { |
|
|
t.Errorf("requesting \"%s\" expected location: \"%s\" but got \"%s\"", requestURI, expectedToLocation, loc.String()) |
|
|
t.Errorf("requesting \"%s\" expected location: \"%s\" but got \"%s\"", requestURI, expectedToLocation, loc.String()) |
|
|
} |
|
|
} |
|
|