Skip to content
Myr

Use Object.create to setup request & response prototypes

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 668f545 · Browse files · 4 files+29 added−8 removed
This commit

State

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

Diff stats

4 files+29 added−8 removed

  • other:+29 added−8 removed

4 files+29 added−8 removed

modified:lib/express.js+10 added-2 removed
modified:lib/request.js+9 added-3 removed
23 unmodified lines
24var proxyaddr = require('proxy-addr');2526/**27 * Request prototype.28 * @public29 */3030var req = exports = module.exports = {31 __proto__: http.IncomingMessage.prototype32};31var req = Object.create(http.IncomingMessage.prototype)3233/**34 * Module exports.35 * @public36 */3738module.exports = req3940/**41 * Return request header.42 *43 * The `Referrer` header field is special-cased,44 * both `Referrer` and `Referer` are interchangeable.
473 unmodified lines
modified:lib/response.js+9 added-3 removed
33 unmodified lines
34var vary = require('vary');3536/**37 * Response prototype.38 * @public39 */4040var res = module.exports = {41 __proto__: http.ServerResponse.prototype42};41var res = Object.create(http.ServerResponse.prototype)4243/**44 * Module exports.45 * @public46 */4748module.exports = res4950/**51 * Module variables.52 * @private53 */54
1017 unmodified lines
modified:History.md+1 added
3 unmodified lines
4 * Add debug message when loading view engine5 * Remove usage of `res._headers` private field6 - Improves compatibility with Node.js 8 nightly7 * Skip routing when `req.url` is not set8 * Use `Object.create` to setup request & response prototypes9 * Use `statuses` instead of `http` module for status messages10 * deps: debug@2.6.111 - Allow colors in workers12 - Deprecated `DEBUG_FD` environment variable set to `3` or higher
3192 unmodified lines