fix: allow 201 for cookies, update header docs (#11472)
This commit is contained in:
parent
1a47277298
commit
508483157d
|
|
@ -110,7 +110,8 @@ func (c *CookieAuthConfig) auth() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
// check either 200 or 201 as some devices may return either
|
||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
|
||||
return fmt.Errorf("cookie auth renewal received status code: %v (%v)",
|
||||
resp.StatusCode,
|
||||
http.StatusText(resp.StatusCode),
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ configuration.
|
|||
# cookie_auth_method = "POST"
|
||||
# cookie_auth_username = "username"
|
||||
# cookie_auth_password = "pa$$word"
|
||||
# cookie_auth_headers = '{"Content-Type": "application/json", "X-MY-HEADER":"hello"}'
|
||||
# cookie_auth_headers = { Content-Type = "application/json", X-MY-HEADER = "hello" }
|
||||
# cookie_auth_body = '{"username": "user", "password": "pa$$word", "authenticate": "me"}'
|
||||
## cookie_auth_renewal not set or set to "0" will auth once and never renew the cookie
|
||||
# cookie_auth_renewal = "5m"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
# cookie_auth_method = "POST"
|
||||
# cookie_auth_username = "username"
|
||||
# cookie_auth_password = "pa$$word"
|
||||
# cookie_auth_headers = '{"Content-Type": "application/json", "X-MY-HEADER":"hello"}'
|
||||
# cookie_auth_headers = { Content-Type = "application/json", X-MY-HEADER = "hello" }
|
||||
# cookie_auth_body = '{"username": "user", "password": "pa$$word", "authenticate": "me"}'
|
||||
## cookie_auth_renewal not set or set to "0" will auth once and never renew the cookie
|
||||
# cookie_auth_renewal = "5m"
|
||||
|
|
|
|||
Loading…
Reference in New Issue