Skip to content
Myr

move `connect.query()` into our repo

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

authored by Roman Shtylman · committed by Roman Shtylman · parent 6b05f60 · Browse files · 4 files+62 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

4 files+62 added−4 removed

  • other:+62 added−4 removed

4 files+62 added−4 removed

modified:lib/application.js+2 added-3 removed
1/**2 * Module dependencies.3 */45var connect = require('connect')6 , mixin = require('utils-merge')5var mixin = require('utils-merge')6 , escapeHtml = require('escape-html')7 , Router = require('./router')8 , methods = require('methods')9 , middleware = require('./middleware')
87 unmodified lines
97 caseSensitive: this.enabled('case sensitive routing'),98 strict: this.enabled('strict routing')99 });100102 this._router.use(connect.query());101 this._router.use(middleware.query());102 this._router.use(middleware.init(this));103 }104};105
433 unmodified lines
modified:lib/middleware.js+35 added-1 removed
modified:lib/utils.js+24 added
154 unmodified lines
155 .replace(/([\/.])/g, '\\$1')156 .replace(/\*/g, '(.*)');157 return new RegExp('^' + path + '$', sensitive ? '' : 'i');158}159160/**161 * Parse the `req` url with memoization.162 *163 * @param {ServerRequest} req164 * @return {Object}165 * @api private166 */167168exports.parseUrl = function(req){169 var parsed = req._parsedUrl;170 if (parsed && parsed.href == req.url) {171 return parsed;172 } else {173 parsed = parse(req.url);174175 if (parsed.auth && !parsed.protocol && ~parsed.href.indexOf('//')) {176 // This parses pathnames, and a strange pathname like //r@e should work177 parsed = parse(req.url.replace(/@/g, '%40'));178 }179180 return req._parsedUrl = parsed;181 }182};
modified:package.json+1 added