creationix/http-parser-js

If both isChunked and hasContentLength, dose content length wins. Why is not the behavior the same as chromium.

Closed this issue · 2 comments

When I'm downloading the same as resource that has both isChunked and hasContentLength, the chromium can do it, but http-parser-js can not.

Technically that's invalid, but http-parser-js likes to handle a lot of things that are invalid. However, if those are both specified, content-length should win, looks like that was updated in this recent PR - first make sure you're using the latest version of http-parser-js, and then if you've got a test case where this is not the case, feel free to provide some details (and ideally a PR!).

Default has recently been changed to be the same as Chromium (chunked encoding taking priority), maybe solving this issue, feel free to re-open if you've got a test case that http-parser-js is still failing on.