diff --git a/helper/test_utilities.go b/helper/test_utilities.go index d0d28ba..6a95b7d 100644 --- a/helper/test_utilities.go +++ b/helper/test_utilities.go @@ -183,12 +183,17 @@ func handleRedirect(w *httptest.ResponseRecorder, req *http.Request) (int, *byte w.Code == http.StatusPermanentRedirect { // Follow external redirect - var err error - req.URL, err = w.Result().Location() + redirURL, err := w.Result().Location() if err != nil { return 0, nil, fmt.Errorf("Invalid location header") } + // TODO: resend orginal request body + req, err := http.NewRequest(req.Method, redirURL.String(), nil) + if err != nil { + return 0, nil, fmt.Errorf("Failed to create new request: %v", err) + } + client := &http.Client{} resp, err := client.Do(req) if err != nil {