Skip to content

Commit 6dcee72

Browse files
vesathngxson
authored andcommitted
server: avoid overwriting Authorization header (ggml-org#10878)
* 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 <[email protected]>
1 parent 16fd9d7 commit 6dcee72

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

examples/server/public/index.html.gz

0 Bytes
Binary file not shown.

examples/server/webui/src/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ const mainApp = createApp({
445445
method: 'POST',
446446
headers: {
447447
'Content-Type': 'application/json',
448-
'Authorization': this.config.apiKey ? `Bearer ${this.config.apiKey}` : undefined,
448+
...(this.config.apiKey ? {'Authorization': `Bearer ${this.config.apiKey}`} : {})
449449
},
450450
body: JSON.stringify(params),
451451
signal: abortController.signal,

0 commit comments

Comments
 (0)