diff --git a/lib/server.js b/lib/server.js index a77630a..3664279 100644 --- a/lib/server.js +++ b/lib/server.js @@ -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) {