Socket
Socket
Sign inDemoInstall

serve-static

Package Overview
Dependencies
Maintainers
6
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve-static - npm Package Compare versions

Comparing version 1.6.4 to 1.6.5

6

HISTORY.md

@@ -0,1 +1,7 @@

1.6.5 / 2015-02-04
==================
* Fix potential open redirect when mounted at root
- Back-ported from v1.7.2
1.6.4 / 2014-10-08

@@ -2,0 +8,0 @@ ==================

21

index.js

@@ -82,6 +82,9 @@ /*!

originalUrl.pathname += '/'
// append trailing slash
originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')
// reformat the URL
var target = url.format(originalUrl)
// send redirect response
res.statusCode = 303

@@ -120,1 +123,17 @@ res.setHeader('Content-Type', 'text/html; charset=utf-8')

exports.mime = send.mime
/**
* Collapse all leading slashes into a single slash
* @private
*/
function collapseLeadingSlashes(str) {
for (var i = 0; i < str.length; i++) {
if (str[i] !== '/') {
break
}
}
return i > 1
? '/' + str.substr(i)
: str
}

2

package.json
{
"name": "serve-static",
"description": "Serve static files",
"version": "1.6.4",
"version": "1.6.5",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

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