Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Weirdly, Mobvious::Manager breaks rails send_file on rails #1

Open
johncant opened this issue Oct 22, 2012 · 3 comments
Open

Weirdly, Mobvious::Manager breaks rails send_file on rails #1

johncant opened this issue Oct 22, 2012 · 3 comments

Comments

@johncant
Copy link
Contributor

The middleware Mobvious::Manager breaks send_file on rails for some reason. I don't yet know why, but the line

    config.middleware.use Mobvious::Manager

breaks send_file in my app, and commenting it out fixes it.

@jistr
Copy link
Owner

jistr commented Oct 22, 2012

Hmm weird. I never used send_file so I never hit this. I think the only thing that changes response is Cookie strategy's response callback [1], so this might be a good place to start debugging. Pull requests are welcome, especially with specs that cover the change ;)

[1] https://github.com/jistr/mobvious/blob/master/lib/mobvious/strategies/cookie.rb#L43-61

@johncant
Copy link
Contributor Author

@app.call on a rails app returns an ActionDispatch::Response as the body. Mobvious::Manager was creating a new Rack::Response, and the Rack::Response constructor was clobbering the body.

I've fixed it and written an extra spec. Please accept my pull request, and thankyou for writing Mobvious!

@milgner
Copy link

milgner commented Jun 16, 2015

Looks like there was heavy discussion on #2 but in the end no fix could be found? I just found Mobvious but if it still breaks send_file, I'd be unable to use it in my project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants