Socket
Socket
Sign inDemoInstall

serve-static

Package Overview
Dependencies
Maintainers
1
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.10.2 to 1.10.3

6

HISTORY.md

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

1.10.3 / 2016-05-30
===================
* deps: send@0.13.2
- Fix invalid `Content-Type` header when `send.mime.default_type` unset
1.10.2 / 2016-01-19

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

18

index.js

@@ -37,3 +37,3 @@ /*!

function serveStatic(root, options) {
function serveStatic (root, options) {
if (!root) {

@@ -72,3 +72,3 @@ throw new TypeError('root path required')

return function serveStatic(req, res, next) {
return function serveStatic (req, res, next) {
if (req.method !== 'GET' && req.method !== 'HEAD') {

@@ -109,3 +109,3 @@ if (fallthrough) {

if (fallthrough) {
stream.on('file', function onFile() {
stream.on('file', function onFile () {
// once file is determined, always forward error

@@ -117,3 +117,3 @@ forwardError = true

// forward errors
stream.on('error', function error(err) {
stream.on('error', function error (err) {
if (forwardError || !(err.statusCode < 500)) {

@@ -136,3 +136,3 @@ next(err)

*/
function collapseLeadingSlashes(str) {
function collapseLeadingSlashes (str) {
for (var i = 0; i < str.length; i++) {

@@ -154,4 +154,4 @@ if (str[i] !== '/') {

function createNotFoundDirectoryListener() {
return function notFound() {
function createNotFoundDirectoryListener () {
return function notFound () {
this.error(404)

@@ -166,4 +166,4 @@ }

function createRedirectDirectoryListener() {
return function redirect() {
function createRedirectDirectoryListener () {
return function redirect () {
if (this.hasTrailingSlash()) {

@@ -170,0 +170,0 @@ this.error(404)

{
"name": "serve-static",
"description": "Serve static files",
"version": "1.10.2",
"version": "1.10.3",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -11,7 +11,11 @@ "license": "MIT",

"parseurl": "~1.3.1",
"send": "0.13.1"
"send": "0.13.2"
},
"devDependencies": {
"istanbul": "0.4.2",
"mocha": "2.3.4",
"eslint": "2.11.1",
"eslint-config-standard": "5.3.1",
"eslint-plugin-promise": "1.3.1",
"eslint-plugin-standard": "1.3.2",
"istanbul": "0.4.3",
"mocha": "2.5.3",
"supertest": "1.1.0"

@@ -28,2 +32,3 @@ },

"scripts": {
"lint": "eslint **/*.js",
"test": "mocha --reporter spec --bail --check-leaks test/",

@@ -30,0 +35,0 @@ "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",

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