Comparing version 0.3.1 to 0.4.0
@@ -34,3 +34,3 @@ const fs = require('fs'); | ||
function is404(res) { | ||
function is404(req, res) { | ||
return (res.statusCode=404,res.end()); | ||
@@ -87,3 +87,3 @@ } | ||
let file = arr.map(x => join(dir, x)).find(fs.existsSync); | ||
if (!file) return next ? next() : isNotFound(res); | ||
if (!file) return next ? next() : isNotFound(req, res); | ||
@@ -123,3 +123,3 @@ let stats = fs.statSync(file); | ||
let data = find(pathname, extensions); | ||
if (!data) return next ? next() : isNotFound(res); | ||
if (!data) return next ? next() : isNotFound(req, res); | ||
@@ -126,0 +126,0 @@ setHeaders(res, pathname, data.stats); |
{ | ||
"name": "sirv", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "The optimized & lightweight middleware for serving requests to static assets", | ||
@@ -5,0 +5,0 @@ "repository": "lukeed/sirv", |
@@ -108,3 +108,3 @@ # sirv [![Build Status](https://travis-ci.org/lukeed/sirv.svg?branch=master)](https://travis-ci.org/lukeed/sirv) | ||
The function receives the current `res <ServerResponse>` as its only argument. | ||
The function receives the current `req <IncomingMessage>, res <ServerResponse>` pair for as its two arguments. | ||
@@ -111,0 +111,0 @@ > **Note:** This won't run if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description. |
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
8838