Skip to content

Commit 2140e6b

Browse files
authored
gandiv5: Add "Bearer" prefix to the auth header (#2029)
1 parent bf8c7ab commit 2140e6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

providers/dns/gandiv5/gandiv5_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func TestDNSProvider(t *testing.T) {
121121
mux.HandleFunc("/domains/example.com/records/_acme-challenge.abc.def/TXT", func(rw http.ResponseWriter, req *http.Request) {
122122
log.Infof("request: %s %s", req.Method, req.URL)
123123

124-
if req.Header.Get("Authorization") == "" {
125-
http.Error(rw, `{"message": "missing Authorization"}`, http.StatusUnauthorized)
124+
if req.Header.Get("Authorization") != "Bearer 123412341234123412341234" {
125+
http.Error(rw, `{"message": "missing or malformed Authorization"}`, http.StatusUnauthorized)
126126
return
127127
}
128128

providers/dns/gandiv5/internal/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (c *Client) do(req *http.Request, result any) error {
134134
}
135135

136136
if c.pat != "" {
137-
req.Header.Set(authorizationHeader, c.pat)
137+
req.Header.Set(authorizationHeader, "Bearer "+c.pat)
138138
}
139139

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

0 commit comments

Comments
 (0)