Skip to content
Myr

Fixed issues introduced by the node url module changes. Closes 126.

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

Everything is good to go now! should run fine. all specs pass.

authored by visionmedia · committed by visionmedia · parent 25b3426 · Browse files · 8 files+13 added−12 removed
This commit

State

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

Diff stats

8 files+13 added−12 removed

  • tests:+3 added−3 removed
  • other:+10 added−9 removed

8 files+13 added−12 removed

modified:lib/express/pages/not-found.js+1 added-1 removed
modified:lib/express/plugins/common-logger.js+1 added-1 removed
modified:lib/express/plugins/profiler.js+1 added-1 removed
modified:lib/express/core.js+1 added-1 removed
145 unmodified lines
146 */147148 match: function(route) {149 if (this.request.method.toLowerCase() == route.method)150 if (this.request.captures = this.request.url.path.match(route.path)) {150 if (this.request.captures = this.request.url.pathname.match(route.path)) {151 this.mapParams(route)152 return true153 }154 },
124 unmodified lines
modified:lib/express/helpers.js+5 added-4 removed
133 unmodified lines
134 return params135}136137/**138 * Parse params _string_ into a nested hash.138 * Parse params _str_ into a nested hash.139 *140 * @param {string} string140 * @param {string} str141 * @return {hash}142 * @api public143 */144145exports.parseParams = function(string) {146 return exports.parseNestedParams($(string.split('&')).reduce({}, function(params, pair){145exports.parseParams = function(str) {146 if (typeof str !== 'string') return147 return exports.parseNestedParams($(str.split('&')).reduce({}, function(params, pair){148 pair = pair.split('=')149 params[pair[0]] = pair[1]150 return params151 }))
1 unmodified line
modified:lib/express/request.js+1 added-1 removed
21 unmodified lines
2223InvalidResponseBody = ExpressError.extend({24 name: 'InvalidResponseBody',25 init: function(request) {26 this.message = request.method + ' ' + JSON.encode(request.url.path) + ' did not respond with a body string'26 this.message = request.method + ' ' + JSON.encode(request.url.pathname) + ' did not respond with a body string'27 }28})2930// --- Helpers
233 unmodified lines
modified:spec/spec.plugins.method-override.js+2 added-2 removed
modified:spec/spec.request.js+1 added-1 removed
156 unmodified lines
157 it 'should access request.url.params'158 get('/user', function(){159 return this.param('page') || 'First page'160 })161 get('/user?page=2').body.should.eql 'First page'161 get('/user').body.should.eql 'First page'162 get('/user?page=2').body.should.eql '2'163 end164165 it 'should work with splats'
8 unmodified lines