Skip to content

Commit 3bda5c9

Browse files
committed
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
1 parent 7b1ec53 commit 3bda5c9

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed
4.96 KB
Binary file not shown.

examples/server/webui/src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ const mainApp = createApp({
442442
method: 'POST',
443443
headers: {
444444
'Content-Type': 'application/json',
445-
'Authorization': this.config.apiKey ? `Bearer ${this.config.apiKey}` : undefined,
445+
...(this.config.apiKey ? {'Authorization': `Bearer ${this.config.apiKey}`} : {})
446446
},
447447
body: JSON.stringify(params),
448448
signal: abortController.signal,

0 commit comments

Comments
 (0)