connect-modrewrite
Advanced tools
Comparing version 0.7.6 to 0.7.7
@@ -7,3 +7,3 @@ | ||
var url = require('url') | ||
, querystring = require('querystring') | ||
, qs = require('qs') | ||
, httpReq = require('http').request | ||
@@ -117,3 +117,3 @@ , httpsReq = require('https').request | ||
if(queryValue) { | ||
req.params = req.query = querystring.parse(queryValue[1]); | ||
req.params = req.query = qs.parse(queryValue[1]); | ||
} | ||
@@ -120,0 +120,0 @@ |
{ | ||
"name": "connect-modrewrite", | ||
"main": "./index.js", | ||
"version": "0.7.6", | ||
"version": "0.7.7", | ||
"description": "connect-modrewrite adds modrewrite functionality to connect/express server", | ||
@@ -29,2 +29,5 @@ "author": { | ||
], | ||
"dependencies": { | ||
"qs": "^0.6.6" | ||
}, | ||
"devDependencies": { | ||
@@ -31,0 +34,0 @@ "grunt-contrib-jshint": "^0.8.0", |
@@ -26,2 +26,21 @@ | ||
describe('Connect-modrewrite', function() { | ||
describe('query params', function() { | ||
it('should keep nested query parameters', function() { | ||
var middleware = modRewrite(['/a /b [L]', '/a /c']); | ||
var req = { | ||
connection : { encrypted : false }, | ||
header : function() {}, | ||
headers : { host : 'test.com' }, | ||
url : '/d?foo[0]=bar&foo[1]=baz&q' | ||
}; | ||
var res = { | ||
writeHead : function() {}, | ||
end : function() {} | ||
}; | ||
var next = function() {}; | ||
middleware(req, res, next); | ||
expect(req.query).to.deep.equal({foo: ['bar','baz'], q: ''}); | ||
}); | ||
}); | ||
describe('non-match', function() { | ||
@@ -28,0 +47,0 @@ it('should leave the url unrewritten if there is no match', function() { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23792
629
1