Skip to content
Myr

Started moving helpers to Request methods

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

authored by visionmedia · committed by visionmedia · parent d7c3d2f · Browse files · 4 files+51 added−39 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+51 added−39 removed

  • other:+51 added−39 removed

4 files+51 added−39 removed

modified:lib/express/core.js+2 added-1 removed
215 unmodified lines
216 * @api private217 */218 219 route: function(request, response){220 trigger('request', { request: request = new Request(request, response) })220 request = new Request(request, response)221 request.trigger('request')222 try {223 if (typeof (body = (new Express.router).route(request)) == 'string')224 halt(200, body)225 }
46 unmodified lines
modified:lib/express/helpers.js-16 removed
115 unmodified lines
116 return header('accept').indexOf(mime(path)) != -1117}118119/**120 * Set response header _key_ and _val_ or get121 * request header value by _key_.122 *123 * @param {string} key124 * @param {string} val125 * @return {string}126 * @api public127 */128129exports.header = function(key, val) {130 return val === undefined ?131 Express.server.request.headers[key.toLowerCase()] :132 Express.server.response.headers[key.toLowerCase()] = val133}134135/**120 * Set response status to _code_.121 *122 * @param {int} code123 * @return {int}
146 unmodified lines
modified:lib/express/plugin.js-14 removed
modified:lib/express/request.js+49 added-8 removed