summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--caddytest/caddytest.go4
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())
}