api: use spread operator for merging headers

This commit is contained in:
dumbmoron 2024-07-06 11:40:41 +00:00
parent 3096bc9df0
commit 92f3d2366c
No known key found for this signature in database

View file

@ -197,8 +197,8 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
} }
streamInfo.headers = new Map([ streamInfo.headers = new Map([
streamInfo.headers || {}, ...(streamInfo.headers || []),
req.headers ...Object.entries(req.headers)
]); ]);
return stream(res, { type: 'internal', ...streamInfo }); return stream(res, { type: 'internal', ...streamInfo });