Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

connect-slashes

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-slashes - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

11

lib/connect-slashes.js

@@ -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;

35

package.json
{
"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": "*"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc