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

Range request: NoMethodError (undefined method `split' for nil:NilClass) #557

Open
bbpennel opened this issue Mar 5, 2024 · 0 comments
Open

Comments

@bbpennel
Copy link

bbpennel commented Mar 5, 2024

Descriptive summary

If a client makes a download request with the Range header but doesn't specify a byte range ("Range: bytes=" ), then the server returns a 500.

Rationale

The server should handle the range header gracefully rather than a server error page.

Expected behavior

I believe the expected behavior is to return the whole file and a 206 status, although i found conflicting information about whether it should instead return a 400. My guess is clients are checking if ranges are supported though, so responding with the whole file makes sense to me.

Actual behavior

Including the header triggers an error. See below.

Steps to reproduce the behavior

Make a request with the Range header like so (when nurax is functional):
curl "https://dev.nurax.samvera.org/downloads/p8418n51k?locale=en" -i -H "Range: bytes="

You should get an error response with an error along the lines of:

NoMethodError (undefined method `split' for nil:NilClass):
  
hydra-core (12.1.0) app/controllers/concerns/hydra/controller/download_behavior.rb:98:in `send_range'
hydra-core (12.1.0) app/controllers/concerns/hydra/controller/download_behavior.rb:69:in `
hydra-core (12.1.0) app/controllers/concerns/hydra/controller/download_behavior.rb:16:in `show'
hyrax (6127e4878a83) app/controllers/hyrax/downloads_controller.rb:21:in `show'
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

1 participant