Skip to content
Myr

move the patch to the response proto

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

authored by Jonathan Ong · committed by Jonathan Ong · parent 74f55a8 · Browse files · 3 files+23 added−45 removed
This commit

State

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

Diff stats

3 files+23 added−45 removed

  • other:+23 added−45 removed

3 files+23 added−45 removed

modified:lib/express.js-3 removed
deleted:lib/patch.js-41 removed
modified:lib/response.js+23 added-1 removed
14 unmodified lines
15 , send = require('send')16 , resolve = require('url').resolve17 , basename = path.basename18 , extname = path.extname19 , mime = send.mime19 , mime = send.mime;20var ServerResponse = http.ServerResponse;21var setHeader = ServerResponse.prototype.setHeader;2223/**24 * Response prototype.25 */
754 unmodified lines
780781 // render782 app.render(view, options, fn);783};784785786/**787 * Set header `field` to `val`, special-casing788 * the `Set-Cookie` field for multiple support.789 *790 * @param {String} field791 * @param {String} val792 * @api public793 */794795res.setHeader = function(field, val){796 var key = field.toLowerCase();797798 if ('content-type' == key && this.charset) {799 val += '; charset=' + this.charset;800 }801802 return setHeader.call(this, field, val);803};