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

Ignore Range header if served file is 0 bytes #2159

Merged
merged 1 commit into from
Feb 26, 2024

Commits on Feb 26, 2024

  1. Ignore Range header if served file is 0 bytes (rack#2159)

    Normally Rack::Files truncates a byte range to fit a file's contents as long as
    at least some bytes are within range. However, an empty (0 byte) file is a
    special case. Previously, empty files requested with a Range header always
    resulted in a 416 error. This changes 0 byte files to ignore the Range header
    and return the empty file.
    
    This improves compatibility with clients that speculatively request files with
    byte ranges.
    zarqman committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    a7be570 View commit details
    Browse the repository at this point in the history