Closed zkrige closed 1 year ago
I'm not sure about this. The latest npm repository has code from 0.7.9 in it, but it lists the version as 0.7.11
Thanks for the fix, but this PR has way too many changes.
The diffs should be against the current version in master
, not against the version in npm. There have been many changes since the npm version (whether or not @cloudhead will find the time to publish is another issue) so that is why you are seeing a different codebase.
There should be no changes to whitespace, etc. unless called for by our ESLint rules. Just the changes relevant for the fix and any tests.
Thanks!
@zkrige, A lot of the code has changed in this pull, and that alone makes it harder to track the significant change.
If i may ask, is the only significant change the added && status !== 206
condition in Server.prototype.finish?
If so, you can just narrow down the change to that line only, unless there's something I'm missing, which I most definitely am. I'm having a hard time understanding the code, unchanged as it is, and forever I will question the usage and function of Response.writeHead
.
@EdricCantu apologies for the noise. I'll reject this PR and create a new one.
The reason for the && status !== 206
condition is as follows:
when there is a byte range, the server returns a 206 code, but it writes out the headers BEFORE this block is reached. Writing out the headers again in this block causes this exception
throw new ERR_HTTP_HEADERS_SENT('write');
resolves #241