jfhbrook / node-ecstatic

A static file server middleware that works with core http, express or on the CLI!
https://github.com/jfhbrook/node-ecstatic
MIT License
975 stars 194 forks source link

fix: response can be aborted during e.g. fs.stat and hasGzipId12 #250

Closed ronag closed 5 years ago

ronag commented 5 years ago

Request/Response can be aborted while doing async stuff... handle it.

Would prefer to use isFinished but I've proposed using the on-finished package in another PR so I'll leave the "modern" node way here.

codecov-io commented 5 years ago

Codecov Report

Merging #250 into master will decrease coverage by 0.44%. The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #250      +/-   ##
==========================================
- Coverage   75.31%   74.86%   -0.45%     
==========================================
  Files          11       11              
  Lines         555      557       +2     
  Branches      126      127       +1     
==========================================
- Hits          418      417       -1     
- Misses         48       51       +3     
  Partials       89       89
Impacted Files Coverage Δ
lib/ecstatic.js 71.86% <50%> (-1.07%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d0c3e94...6853bea. Read the comment docs.

ronag commented 5 years ago

I honestly have no idea how to fix the code coverage on this...

jfhbrook commented 5 years ago

I'm honestly not sure how to test this either, these kinda time-dependent things are tough! I say don't sweat the codecov report, I'm not 100% taking it to heart.

ronag commented 5 years ago

I implemented this in the on-finished PR with onFinished.isFinished.

https://github.com/jfhbrook/node-ecstatic/pull/249