mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-02 05:04:28 -04:00
report error on failed location response (#3184)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
2eede58b3a
commit
d08cbefff8
@ -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())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user