Skip to content
Myr

no longer manipulate the req/res protos directly

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 429e48d · Browse files · 4 files+27 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+27 added−8 removed

  • other:+27 added−8 removed

4 files+27 added−8 removed

modified:lib/application.js+5 added-1 removed
11 unmodified lines
12var connect = require('connect')13 , Router = require('./router')14 , toArray = require('./utils').toArray15 , methods = Router.methods.concat('del', 'all')16 , request = require('./request')16 , res = require('./response')17 , response = require('./response')18 , View = require('./view')19 , url = require('url')20 , utils = connect.utils21 , path = require('path')
89 unmodified lines
111 req.res = res;112 res.req = req;113 req.next = next;114115 req.__proto__ = request;116 res.__proto__ = response;117118 res.locals = function(obj){119 for (var key in obj) res.locals[key] = obj[key];120 return res;121 };
472 unmodified lines
modified:lib/express.js+6 added-5 removed
modified:lib/request.js+8 added-1 removed
8 unmodified lines
9 * Module dependencies.10 */1112var http = require('http')13 , req = http.IncomingMessage.prototype13 , utils = require('./utils')14 , connect = require('connect')15 , parse = require('url').parse16 , mime = require('mime');1718/**19 * Request prototype.20 */2122var req = exports = module.exports = {23 __proto__: http.IncomingMessage.prototype24};2526/**27 * Default notification formatters.28 */2930var defaultFormatters = exports.formatters = {
349 unmodified lines
modified:lib/response.js+8 added-1 removed
13 unmodified lines
14 , path = require('path')15 , connect = require('connect')16 , utils = connect.utils17 , statusCodes = http.STATUS_CODES18 , res = http.ServerResponse.prototype18 , send = connect.static.send19 , mime = require('mime')20 , basename = path.basename21 , join = path.join;2223/**24 * Response prototype.25 */2627var res = module.exports = {28 __proto__: http.ServerResponse.prototype29};3031/**32 * Send a response.33 *34 * Examples:35 *
522 unmodified lines