Skip to content

Commit

Permalink
gandiv5: Add "Bearer" prefix to the auth header (#2029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph-D authored Oct 7, 2023
1 parent bf8c7ab commit 2140e6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions providers/dns/gandiv5/gandiv5_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func TestDNSProvider(t *testing.T) {
mux.HandleFunc("/domains/example.com/records/_acme-challenge.abc.def/TXT", func(rw http.ResponseWriter, req *http.Request) {
log.Infof("request: %s %s", req.Method, req.URL)

if req.Header.Get("Authorization") == "" {
http.Error(rw, `{"message": "missing Authorization"}`, http.StatusUnauthorized)
if req.Header.Get("Authorization") != "Bearer 123412341234123412341234" {
http.Error(rw, `{"message": "missing or malformed Authorization"}`, http.StatusUnauthorized)
return
}

Expand Down
2 changes: 1 addition & 1 deletion providers/dns/gandiv5/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Client) do(req *http.Request, result any) error {
}

if c.pat != "" {
req.Header.Set(authorizationHeader, c.pat)
req.Header.Set(authorizationHeader, "Bearer "+c.pat)
}

resp, err := c.HTTPClient.Do(req)
Expand Down

0 comments on commit 2140e6b

Please sign in to comment.