Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

rest: fix TestStripHeadersOnCrossHostRedirectFn failing on go1.26

Nick Craig-Woodf440573c3eae
diff --git a/lib/rest/rest_test.go b/lib/rest/rest_test.go
index cb689388b..3d4351fe2 100644
--- a/lib/rest/rest_test.go
+++ b/lib/rest/rest_test.go
@@ -386,6 +386,9 @@ func TestStripHeadersOnCrossHostRedirectFn(t *testing.T) {
require.NoError(t, err)
http.Redirect(w, r, "http://LOCALHOST:"+u.Port()+"/redirected", http.StatusTemporaryRedirect)
case "/redirected":
+ // Before go1.27 net/http compares hosts case
+ // sensitively and drops Authorization itself here.
+ r.Header.Set("Authorization", stripTestHeaders["Authorization"])
assertKept(r)
w.WriteHeader(http.StatusOK)
default: