connect-slashes
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -30,2 +30,6 @@ /** | ||
// Only create RegExp objects once | ||
var reQuery = /[\?\&]+/; | ||
var reAbsolute = /^(\/\/+)/; | ||
var slashes = function( append ) { | ||
@@ -37,6 +41,9 @@ ( append === false ) || ( append = true ); // default to append slashes mode | ||
if ( "GET" == req.method ) { | ||
var url = req.url.split( /[\?\&]+/ ) | ||
var url = req.url.split( reQuery ) | ||
, location = url[ 0 ] | ||
, redirect; | ||
// Prevent redirect to absolute URLs (see issue #2) | ||
location = location.replace( reAbsolute, "/" ); | ||
if ( append && "/" != location[ location.length - 1 ] ) { | ||
@@ -74,2 +81,2 @@ | ||
// | ||
module.exports = slashes; | ||
module.exports = slashes; |
{ | ||
"name": "connect-slashes" | ||
, "version": "0.0.10" | ||
, "description": "Trailing slash redirect middleware for Connect" | ||
, "keywords": ["trailing", "slash", "connect", "middleware"] | ||
, "author": "Roi Avinoam <avinoamr@gmail.com>" | ||
, "contributors": [ | ||
"Feross Aboukhadijeh <feross@feross.org> (http://feross.org)" | ||
, "brunogfranca (https://github.com/brunogfranca)" | ||
] | ||
, "repository": { | ||
"type": "git" | ||
, "url": "git@github.com:avinoamr/connect-slashes.git" | ||
} | ||
, "dependencies": {} | ||
, "main": "index" | ||
, "engines": { "node": "*" } | ||
"name": "connect-slashes", | ||
"version": "0.0.11", | ||
"description": "Trailing slash redirect middleware for Connect", | ||
"keywords": [ "trailing", "slash", "connect", "middleware" ], | ||
"author": "Roi Avinoam <avinoamr@gmail.com>", | ||
"contributors": [ | ||
"Feross Aboukhadijeh <feross@feross.org> (http://feross.org)", | ||
"brunogfranca (https://github.com/brunogfranca)" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/avinoamr/connect-slashes.git" | ||
}, | ||
"dependencies": {}, | ||
"main": "index", | ||
"license": "MIT", | ||
"engines": { | ||
"node": "*" | ||
} | ||
} |
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
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
4194
0
63