From d08cbefff8377c5011c3fc7fb7bc576ac9f56be2 Mon Sep 17 00:00:00 2001 From: Mark Sargent <99003+sarge@users.noreply.github.com> Date: Tue, 24 Mar 2020 16:18:53 +1300 Subject: report error on failed location response (#3184) Co-authored-by: Matt Holt --- caddytest/caddytest.go | 4 ++++ 1 file changed, 4 insertions(+) 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()) } -- cgit v1.2.3