Skip to content

Commit

Permalink
server: avoid overwriting Authorization header (#10878)
Browse files Browse the repository at this point in the history
* server: avoid overwriting Authorization header

If no API key is set, leave the Authorization header as is. It may be
used by another part of the Web stack, such as an authenticating proxy.

Fixes #10854

* rebuild

---------

Co-authored-by: Xuan Son Nguyen <[email protected]>
  • Loading branch information
vesath and ngxson authored Dec 18, 2024
1 parent 152610e commit 7bbb5ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified examples/server/public/index.html.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/server/webui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ const mainApp = createApp({
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': this.config.apiKey ? `Bearer ${this.config.apiKey}` : undefined,
...(this.config.apiKey ? {'Authorization': `Bearer ${this.config.apiKey}`} : {})
},
body: JSON.stringify(params),
signal: abortController.signal,
Expand Down

0 comments on commit 7bbb5ac

Please sign in to comment.