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

The Range header is non-inclusive #298

Closed
mjishnu opened this issue Jun 16, 2024 · 1 comment
Closed

The Range header is non-inclusive #298

mjishnu opened this issue Jun 16, 2024 · 1 comment
Labels
🪲 bug Something isn't working 🎛️ server There are things to do on the server

Comments

@mjishnu
Copy link
Contributor

mjishnu commented Jun 16, 2024

Describe the bug
The range header provided by Api endpoint is non inclusive this prevents concurrent downloaders which uses range headers to produce corrupt parts

expected: Range: bytes=0-499 should give 500 bytes
actual: Range: bytes=0-499 gives 499 bytes

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range

Reproduce

trying to download OpenTTD with a size of 7304357 bytes from demo server.

curl -X 'GET' \
  'https://demo.gamevau.lt/api/games/5/download' \
  -H 'accept: application/json' \
  -H 'Range: 0-7304356' \
  -H 'Authorization: Basic ZGVtbzpkZW1vZGVtbw=='
curl -X 'GET' \
  'https://demo.gamevau.lt/api/games/5/download' \
  -H 'accept: application/json' \
  -H 'Range: 0-7304357' \
  -H 'Authorization: Basic ZGVtbzpkZW1vZGVtbw=='

the first curl gives a corrupt file, where as the 2nd one gives the correct file, this is not the desired behavior as http range headers should be inclusive first curl should produce the correct file.

@mjishnu mjishnu added 🎛️ server There are things to do on the server 🪲 bug Something isn't working labels Jun 16, 2024
@Alfagun74
Copy link
Contributor

Alfagun74 commented Jun 16, 2024

Thanks for reporting and fixing this oversight, it will release with the next gamevault-backend version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working 🎛️ server There are things to do on the server
Projects
Archived in project
Development

No branches or pull requests

2 participants