Closed Icehunter closed 4 days ago
Just wanted to note on here it looks like just a rebase, without addressing the review comments yet. I presume that will come in follow up commits?
Just wanted to note on here it looks like just a rebase, without addressing the review comments yet. I presume that will come in follow up commits?
Yes, working on that now.
@dougwilson I found all the comments I think needed to be fixed, except 2 perhaps that I'll work on tonight.
@dougwilson Is there anything more you see for this PR to have? @sogaani with regards to your comment on the error status code; it seems to be a big edge case. I work on a very large API and haven't encountered this issue before.
I was under the impression you were going to make changes in regards to the two bullet points above, which is what I'm waiting on. I never saw any additional comments after that message. Are you still working on them?
Eh! Sorry; I did leave the on('data') callback as is in the test, but I removed all the logs and I believe covered everything you had commented on in the previous test.
For the second bullet point I quite literally have no clue off the top of my head how to even cover that in an edge case test.
Seems like this one got stuck right?
@Icehunter, you might want to correct the indentations at line 740-744 and line 747-753. I didn't include them previously so that https://github.com/expressjs/compression/pull/170/commits/38fe9fd5756f524e438c9abb9e91e7193921e0e3 is surgical.
@Icehunter, for the clarity that #129 is not in this PR, the description should change:
updated PR with rebase from express/compress:master to handle #128
and #129
@Icehunter, for the clarity that #129 is not in this PR, the description should change:
updated PR with rebase from express/compress:master to handle #128 ~and #129~
Updated and rebased again :)
@dougwilson When you are free, can you review this PR? Fixes #122 and supersedes #128. Many thanks! 🤗
I didn't have access in the forked repository to run the GH actions. So I forked the PR. I ran the GH actions on my own repository and here is the result for the latest commit (4c1d27b): https://github.com/lamweili/compression/actions
@dougwilson, have you got the time to take a look at this PR?
sorry @Icehunter, Can you fix the code style?
sorry @Icehunter, Can you fix the code style?
Sure thing.
Dropping some context from slack re: this PR
The original issue here is compression relying on node http internals since the days of connect in 2011
Here's when the commit w/
_implicitHeader
originally landed:https://github.com/senchalabs/connect/commit/715e4f56f8e4ad75baa35a7ae049bd69ca8bf6c6
http2 module has a different API and internals than http1 in node. So that method doesn't exist at all in http2, throwing when used.
Compression module doesn't support http2 explicitly. It likely can, but was never intended to.
writeHead
has been around since that first commit, but for reasons lost to time wasn't used
Idk that I can say that issue #122 "supporting http2" is closed after landing #170, because I personally haven't reviewed the code or tested for http2 edgecases.
However, removing an http internal to replace w/ a public interface which is equivalent is 💯
It doesn't look like _implicitHeader
implementation has changed much since Node v0.4.12
:
https://github.com/nodejs/node/blob/v0.4.12/lib/http.js#L796
Here it is in v23: https://github.com/nodejs/node/blob/v23.1.0/lib/_http_server.js#L336
This history is long w/ 19 commits, @bjohansebas when/if you merge I'd suggest squashing via the dropdown to keep the history clean
history.md isn't updated in this PR, we've talked about dropping that file (at least blake is planning to do so) but just a reminder in case you want to make sure you don't forget changelog update
updated PR with rebase from express/compress:master to handle #128