Watch
0
0
Fork
You've already forked hyperhive
0

repeat the security headers in the swarm api 401 location

This commit is contained in:
atlas 2026-10-28 23:24:34 +01:00
commit 46693b3c25

View file

@ -323,8 +323,12 @@ in
# 401 with a `WWW-Authenticate` header, which the UI reads as "log 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 # 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. # 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 = '' "@swarm_api_unauthorized".extraConfig = ''
${gatewayCfg.lib.securityHeaders}
if ($http_authorization) { if ($http_authorization) {
${gatewayCfg.lib.securityHeaders}
add_header WWW-Authenticate 'Bearer realm="swarm"' always; add_header WWW-Authenticate 'Bearer realm="swarm"' always;
return 401; return 401;
} }