Skip to content

Commit bfa0298

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 4da69d1 commit bfa0298

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed
5.09 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
@@ -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)