diff options
author | Mark Sargent <99003+sarge@users.noreply.github.com> | 2020-03-24 16:18:53 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 21:18:53 -0600 |
commit | d08cbefff8377c5011c3fc7fb7bc576ac9f56be2 (patch) | |
tree | e229410588df382c1c6fe80a28cf17ea4f1c3c9d | |
parent | 2eede58b3a0f39d0cb0552eadaec02a0169835ac (diff) |
report error on failed location response (#3184)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
-rw-r--r-- | caddytest/caddytest.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/caddytest/caddytest.go b/caddytest/caddytest.go index a020be9..ed503eb 100644 --- a/caddytest/caddytest.go +++ b/caddytest/caddytest.go @@ -301,6 +301,10 @@ func AssertRedirect(t *testing.T, requestURI string, expectedToLocation string, } 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() { t.Errorf("requesting \"%s\" expected location: \"%s\" but got \"%s\"", requestURI, expectedToLocation, loc.String()) } |