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

PhusionPassenger::Utils::TeeInput should support seek method #1553

Closed
bachue opened this issue Jul 3, 2015 · 1 comment
Closed

PhusionPassenger::Utils::TeeInput should support seek method #1553

bachue opened this issue Jul 3, 2015 · 1 comment
Assignees
Milestone

Comments

@bachue
Copy link

bachue commented Jul 3, 2015

When an http request comes with GZip compressed, some request handler use Zlib::GzipReader to read from TeeInput (because it's in env['rack.input'], e.g. https://github.com/schacon/grack/blob/master/lib%2Fgrack.rb#L243), then if someone call request.body.rewind, the error happens:

undefined method `seek' for #PhusionPassenger::Utils::TeeInput:0x0000000d4c7ab8

The reason is GzipReader calls seek to do rewind

rewind()
Resets the position of the file pointer to the point created the GzipReader object. The associated IO object needs to respond to the seek method.

So can TeeInput implement seek? Thanks.

@OnixGH OnixGH self-assigned this Aug 6, 2015
@OnixGH
Copy link
Contributor

OnixGH commented Aug 6, 2015

Technically env['rack.input'] only needs to implement rewind (per the Rack specification) so Zlib::GzipReader is apparently depending on an optional feature.

But we'll see what we can do :)

@OnixGH OnixGH closed this as completed in 5705c7b Aug 11, 2015
@FooBarWidget FooBarWidget added this to the 5.0.16 milestone Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants