Skip to content

Commit

Permalink
server: use setter for headers in _sendError
Browse files Browse the repository at this point in the history
Use setter method for headers, thanks @mbaumgartl for the suggestion

Co-authored-by: Marco Baumgartl <[email protected]>
  • Loading branch information
nicokaiser and mbaumgartl committed Aug 8, 2024
1 parent 34af875 commit 4d7acd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ class Server {
if (err.data) response.data = err.data;
if (err.meta && typeof err.meta === 'object') {
if (typeof err.meta.headers === 'object') {
for (let header in err.meta.headers) {
response.meta.headers[header] = err.meta.headers[header];
for (let [header, value] of Object.entries(err.meta.headers || {})) {
response.header(header, value);
}
}
for (let key in err.meta) {
Expand Down

0 comments on commit 4d7acd5

Please sign in to comment.