Skip to content
Myr

Pass res.send() headers through res.header()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 2e8e705 · Browse files · 1 file+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:lib/express/response.js+7 added-2 removed
50 unmodified lines
51 }5253 // Defaults54 status = status || 200;55 headers = headers || {};5556 // Determine content type57 switch (typeof body) {58 case 'number':
28 unmodified lines
87 : Buffer.byteLength(body));88 }8990 // Merge headers passed92 utils.merge(this.headers, headers);91 if (headers) {92 var fields = Object.keys(headers);93 for (var i = 0, len = fields.length; i < len; ++i) {94 var field = fields[i];95 this.header(field, headers[field]);96 }97 }9899 // Respond100 this.writeHead(status, this.headers);101 this.end(body);
170 unmodified lines