diff --git a/packages/send-type/index.js b/packages/send-type/index.js index 07ed619..83cecaa 100644 --- a/packages/send-type/index.js +++ b/packages/send-type/index.js @@ -12,7 +12,10 @@ module.exports = function (res, code=200, data='', headers={}) { let type = obj[TYPE] || res.getHeader(TYPE); if (!!data && typeof data.pipe === 'function') { - res.setHeader(TYPE, type || OSTREAM); + obj[TYPE] = type || OSTREAM; + for (k in obj) { + res.setHeader(k, obj[k]); + } return data.pipe(res); }