Skip to content
Myr

Docs

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

authored by visionmedia · committed by visionmedia · parent 75d0abd · Browse files · 1 file+23 added−4 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+23 added−4 removed

  • other:+23 added−4 removed

1 file+23 added−4 removed

modified:lib/express.core.js+23 added-4 removed
261 unmodified lines
262 argsArray : function(args, offset) {263 return Array.prototype.slice.call(args, offset)264 },265 266 /**267 * Check if _route_ matches the proper _request_ method.268 *269 * @param {hash} route270 * @param {hash} request271 * @return {bool}272 * @api public273 */274 275 routeMethod : function(route, request) {276 return route.method.toUpperCase() == request.method277 },278 279 /**280 * Check if _route_ matches provides the proper281 * encoding types listed in _request_'s Accept header.282 *283 * @param {hash} route284 * @param {hash} request285 * @return {bool}286 * @api public287 */288 289 routeProvides : function(route, request) {290 if (!route.options.provides) return true291 if (route.options.provides.constructor != Array) 292 route.options.provides = [route.options.provides]
44 unmodified lines
337 * @api public338 */339 340 routeMatches : function(route, request) {322 var conditions = [Express.routeMethod]323 for (i = 0, len = conditions.length; i < len; ++i)324 if (!conditions[i](route, request))325 return false341 // var conditions = [Express.routeMethod]342 // for (i = 0, len = conditions.length; i < len; ++i)343 // if (!conditions[i](route, request))344 // return false345 switch (route.path.constructor) {346 case String: return route.path == request.uri.path347 case RegExp: return !! (Express.captures = request.uri.path.match(route.path))348 }
63 unmodified lines