From e335174f15e556bde36bcb1bae6872b075a72309 Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Thu, 5 Oct 2023 13:56:24 +0000 Subject: [PATCH] Fix missing "Bearer" in authorization header --- director/redirect_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/director/redirect_test.go b/director/redirect_test.go index dbcc49a4e..568662238 100644 --- a/director/redirect_test.go +++ b/director/redirect_test.go @@ -134,7 +134,7 @@ func TestDirectorRegistration(t *testing.T) { r.POST("/", RegisterOrigin) c.Request, _ = http.NewRequest(http.MethodPost, "/", bytes.NewBuffer([]byte(`{"Namespaces": [{"Path": "/foo/bar", "URL": "https://get-your-tokens.org"}]}`))) - c.Request.Header.Set("Authorization", string(signed)) + c.Request.Header.Set("Authorization", "Bearer "+string(signed)) c.Request.Header.Set("Content-Type", "application/json") // Hard code the current min version. When this test starts failing because of new stuff in the Director, // we'll know that means it's time to update the min version in redirect.go @@ -186,7 +186,7 @@ func TestDirectorRegistration(t *testing.T) { rInv.POST("/", RegisterOrigin) cInv.Request, _ = http.NewRequest(http.MethodPost, "/", bytes.NewBuffer([]byte(`{"Namespaces": [{"Path": "/foo/bar", "URL": "https://get-your-tokens.org"}]}`))) - cInv.Request.Header.Set("Authorization", string(signedInv)) + cInv.Request.Header.Set("Authorization", "Bearer "+string(signedInv)) cInv.Request.Header.Set("Content-Type", "application/json") // Hard code the current min version. When this test starts failing because of new stuff in the Director, // we'll know that means it's time to update the min version in redirect.go @@ -218,7 +218,7 @@ func TestDirectorRegistration(t *testing.T) { rInv.POST("/", RegisterOrigin) cInv.Request, _ = http.NewRequest(http.MethodPost, "/", bytes.NewBuffer([]byte(`{"Namespaces": [{"Path": "/foo/bar", "URL": "https://get-your-tokens.org"}]}`))) - cInv.Request.Header.Set("Authorization", string(signedInv)) + cInv.Request.Header.Set("Authorization", "Bearer "+string(signedInv)) cInv.Request.Header.Set("Content-Type", "application/json") cInv.Request.Header.Set("User-Agent", "pelican-origin/6.0.0")