Skip to content

Commit

Permalink
server: avoid overwriting Authorization header (ggml-org#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 ggml-org#10854

* rebuild

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
  • Loading branch information
2 people authored and mglambda committed Mar 8, 2025
1 parent 466f22a commit 8027308
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 8027308

Please sign in to comment.