You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improvements for README. #177 on README improvements; I figure some would be good, but would like to continue showing output and keeping headings (useful in navigation for users of HeadingsMap type browser add-ons, as well as for accessibility in general)
Renaming static to nodeStatic #172 - There is no longer a need for avoiding the reserved static keyword, as I renamed the examples (to use statik).
[writeHead] survive if http.serverResponse.writeHead() re-defined #166 - I guess we could protect overwrites to writeHead, but what's to prevent someone from rewriting setHeader? If it's a common enough use case to overwrite writeHead, I could add the preventative measure, esp. with a test.
Remaining steps:
The Unauthorized File Access issue https://www.npmjs.com/advisories/1206 does not appear to be an issue per testing (if it ever was); if you can provide a test case where it fails, please report
I've added nyc for coverage, but I'm not sure that with vows, we can do binary file testing. I'm thinking whether we should switch to mocha for this (I prefer that to jest for the ecosystem). Ideally we'd get to full coverage, including the binary.
Hi,
As issues had not received feedback here and the latest commit 3 years ago, I went ahead to make a fork and publish it as @brettz9/node-static.
Besides making a few of my own changes:
enginesto 10.11.0+ (allowing native URL to fix an issue and better flexibility in language features)URLconstructor over deprecatedurl.parse;should fix Open Redirect issue https://www.npmjs.com/advisories/1207
colorsCHANGES.md)...the fork also incorporates the following, indicating also the PR numbers here that they close:
User-facing
optimisttoneodoc(@fidian); Fix vulnerabilities found with npm audit #222mimeandcolors(@fidian); Fix vulnerabilities found with npm audit #222fs.statcalls from bad path arguments; fixesDenial of Service issue https://www.npmjs.com/advisories/1208
(@brpvieira); Protect fs.stat calls from invalid path arguments #223; also avoids need for Prevent DoS attack #213
bytes=0-0Range header (@prajwalkman); Properly handle "bytes=0-0" range header #167spa, allow dots after path (@gjuchault); fix(spa): parse URL before matching files for 404 #204serverInfoto benull(@martindale); Allow Removal ofServerHeader #150--cache 0(@matthew-andrews); Respect static --cache 0 #138defaultExtension(@fmalk); New option: defaultExtension #173Dev-facing
I also made some updates/improvements to the PRs:
fs.statchecking, adding one beyond that covered in the originalfs.statPR (Protect fs.stat calls from invalid path arguments #223), and covering the newly-added one in thedefaultExtensionPR (New option: defaultExtension #173).minimatch(Added glob matching feature for setting cache headers. #183)These remaining prexisting PRs were not fully incorporated:
fandfalsealiases, feel free to file an issuestatictonodeStatic#172 - There is no longer a need for avoiding the reservedstatickeyword, as I renamed the examples (to usestatik).writeHead, but what's to prevent someone from rewritingsetHeader? If it's a common enough use case to overwritewriteHead, I could add the preventative measure, esp. with a test.Remaining steps:
nycfor coverage, but I'm not sure that withvows, we can do binary file testing. I'm thinking whether we should switch tomochafor this (I prefer that to jest for the ecosystem). Ideally we'd get to full coverage, including the binary.