Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "st", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "A module for serving static files. Does etags, caching, etc.", | ||
@@ -5,0 +5,0 @@ "main": "st.js", |
21
st.js
@@ -273,2 +273,14 @@ module.exports = st | ||
var isDirectory = stat.isDirectory() | ||
if (isDirectory) { | ||
end() // we won't need this fd for a directory in any case | ||
if (next && this.opt.passthrough === true && this._index === false) { | ||
// this is done before if-modified-since and if-non-match checks so | ||
// cached modified and etag values won't return 304's if we've since | ||
// switched to !index. See Issue #51. | ||
return next() | ||
} | ||
} | ||
var ims = req.headers['if-modified-since'] | ||
@@ -289,11 +301,2 @@ if (ims) ims = new Date(ims).getTime() | ||
var isDirectory = stat.isDirectory() | ||
if (isDirectory) { | ||
end() | ||
if (next && this.opt.passthrough === true && this._index === false) { | ||
return next() | ||
} | ||
} | ||
// only set headers once we're sure we'll be serving this request | ||
@@ -300,0 +303,0 @@ if (!res.getHeader('cache-control') && this._cacheControl) |
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
54555
1290