repeat the security headers in the swarm api 401 location
This commit is contained in:
parent
c209e49ee7
commit
46693b3c25
1 changed files with 4 additions and 0 deletions
|
|
@ -323,8 +323,12 @@ in
|
|||
# 401 with a `WWW-Authenticate` header, which the UI reads as "log in
|
||||
# again" and answers with a reload. The header is also how the UI tells
|
||||
# this 401 from one the controller sends for its own reasons.
|
||||
# The security headers are repeated inside the `if` block that sets its
|
||||
# own `add_header`, which would otherwise drop them.
|
||||
"@swarm_api_unauthorized".extraConfig = ''
|
||||
${gatewayCfg.lib.securityHeaders}
|
||||
if ($http_authorization) {
|
||||
${gatewayCfg.lib.securityHeaders}
|
||||
add_header WWW-Authenticate 'Bearer realm="swarm"' always;
|
||||
return 401;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue