Skip to content

Commit

Permalink
Fix missing "Bearer" in authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Oct 5, 2023
1 parent 76cdc39 commit e335174
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions director/redirect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit e335174

Please sign in to comment.