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

Rack 2.1.0 breaks ActiveStorage #1464

Closed
thedanbob opened this issue Jan 10, 2020 · 4 comments
Closed

Rack 2.1.0 breaks ActiveStorage #1464

thedanbob opened this issue Jan 10, 2020 · 4 comments

Comments

@thedanbob
Copy link

I submitted this issue to Rails and they sent me here.

Rack::File (now Rack::Files) no longer accepts nil as a first parameter per this commit: 8f85307. File.expand_path throws a TypeError.

This breaks the ActiveStorage file server: https://github.com/rails/rails/blob/master/activestorage/app/controllers/concerns/active_storage/file_server.rb#L6

@ioquatix
Copy link
Member

What do you think is the right behaviour?

  • Do nothing - nil is not a valid root path.
  • Allow nil root path - potentially other operations broken (although maybe not in practice).

I'm not quite sure what is the right way forward. We did break backwards compatibility.

@rafaelfranca
Copy link
Collaborator

I think we should keep nil being a valid path, at least in 2.1. It works today for Active Storage use case.

@ioquatix
Copy link
Member

Okay I can make a PR.

@rafaelfranca
Copy link
Collaborator

👍

ioquatix added a commit that referenced this issue Jan 10, 2020
Fix ActiveStorage use-case and add test case. Fixes #1464.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants