forked from TrueCloudLab/lego
gandiv5: Add "Bearer" prefix to the auth header (#2029)
This commit is contained in:
parent
bf8c7abf6d
commit
2140e6befe
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue