Skip to content

best way to save what you love

api: use spread operator for merging headers

dumbmoron92f3d2366cf8
diff --git a/src/core/api.js b/src/core/api.js
index cf5b51a5..8eb4cb40 100644
--- a/src/core/api.js
+++ b/src/core/api.js
@@ -197,8 +197,8 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
}
streamInfo.headers = new Map([
- streamInfo.headers || {},
- req.headers
+ ...(streamInfo.headers || []),
+ ...Object.entries(req.headers)
]);
return stream(res, { type: 'internal', ...streamInfo });