Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got.stream does not handle HPE_HEADER_OVERFLOW errors #803

Closed
kapouer opened this issue May 19, 2019 · 3 comments
Closed

got.stream does not handle HPE_HEADER_OVERFLOW errors #803

kapouer opened this issue May 19, 2019 · 3 comments
Labels
documentation The issue will improve the docs

Comments

@kapouer
Copy link

kapouer commented May 19, 2019

  • Node.js version: 10.15.2
  • OS & version: linux debian/buster

When the requested url sends >= 8KB http headers

got.stream('/hpe').pipe(mywritestream)

throws an unhandled rejection corresponding to a RequestError, code 'HPE_HEADER_OVERFLOW', message 'Parse Error'.

I suppose it should handle emit an error on the stream ?

@sindresorhus
Copy link
Owner

You could increase the allowed header size: https://stackoverflow.com/a/55298067

Not really anything to handle for Got or you as the steam is already in an error state at that point.

@sindresorhus
Copy link
Owner

Oh sorry, I missed that it was "unhandled". .pipe() doesn't forward errors (which I incredible dumb). However, you can use Stream.pipeline instead, which properly forwards errors. We should definitely update our docs to use that instead.

@kapouer
Copy link
Author

kapouer commented May 19, 2019

TIL Stream.pipeline ! Awesome !

@szmarczak szmarczak added the documentation The issue will improve the docs label Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue will improve the docs
Projects
None yet
Development

No branches or pull requests

3 participants