Commit f265783
committed
fix(server): omit Authorization header on peer-proxy when caller provides no key
`_proxy_to_peer` set `"Authorization": ""` when `api_key` was empty — a
blank-value header, not a missing one. Many HTTP proxies and uvicorn
front-ends (nginx, traefik) reject `Authorization: ""` with 400 Bad
Request, breaking peer routing for anonymous requests to public hubs.
Fix: build the headers dict without the Authorization key and add it only
when `api_key` is non-empty, matching the correct "omit, don't blank"
contract for optional bearer tokens.1 parent 5eb5982 commit f265783
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1220 | 1220 | | |
1221 | 1221 | | |
1222 | 1222 | | |
1223 | | - | |
1224 | | - | |
| 1223 | + | |
1225 | 1224 | | |
1226 | 1225 | | |
1227 | 1226 | | |
| 1227 | + | |
| 1228 | + | |
1228 | 1229 | | |
1229 | 1230 | | |
1230 | 1231 | | |
| |||
0 commit comments