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

Error for payloads with content-encoding that fail maxBytes test #5

Closed
ggoodman opened this issue Feb 3, 2015 · 2 comments
Closed

Error for payloads with content-encoding that fail maxBytes test #5

ggoodman opened this issue Feb 3, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@ggoodman
Copy link

@ggoodman ggoodman commented Feb 3, 2015

Subtext replaces the original source stream (which is an instance of Request) with an instance of Gunzip when Content-Encoding: gzip (see https://github.com/hapijs/subtext/blob/master/lib/index.js#L114).

Subtext then hands off the request to Wreck. When the payload fails the maxBytes test, an error event is raised and Wreck attempts to destroy() the request (see https://github.com/hapijs/wreck/blob/master/lib/index.js#L271). However, as noted above, the stream passed to Wreck in this case is not a request, but instead an instance of Gunzip that has no destroy() method. Disaster ensues. (See also hapijs/wreck#71)

It seems that there may be a need to distinguish the payload stream from the request object passed into Wreck or otherwise remove Wreck's assumption that it is acting on a Request stream.

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Feb 20, 2015

Wouldn't just not calling destroy() in wreck solve it then?

@hueniverse hueniverse added the bug label Feb 20, 2015
@hueniverse hueniverse self-assigned this Jul 1, 2015
@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Jul 1, 2015

The bug is in wreck. As soon as that's published I'll update the deps here and in hapi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.