Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Sep 29, 2025

This PR adds Gateway.MaxRangeRequestFileSize configuration to protect against CDN bugs where range requests over certain sizes return entire files instead of requested byte ranges, causing unexpected bandwidth costs.

also introduces OptionalBytes type to reduce code duplication when handling byte-size configuration values, replacing manual string parsing with humanize.ParseBytes. migrates existing byte-size configs to use this new type.

adds Gateway.MaxRangeRequestFileSize configuration to protect against CDN bugs
where range requests over certain sizes return entire files instead of requested
byte ranges, causing unexpected bandwidth costs.

- default: 0 (no limit)
- returns 501 Not Implemented for oversized range requests
- protects against CDNs like Cloudflare that ignore range requests over 5GiB

also introduces OptionalBytes type to reduce code duplication when handling
byte-size configuration values, replacing manual string parsing with humanize.ParseBytes.
migrates existing byte-size configs to use this new type.

Fixes: ipfs/boxo#856
@lidel lidel requested a review from a team as a code owner September 29, 2025 19:06
@guillaumemichel guillaumemichel self-requested a review October 7, 2025 14:44
@gammazero gammazero merged commit 93f8897 into master Nov 12, 2025
16 checks passed
@gammazero gammazero deleted the feat/gateway-max-range-request-file-size branch November 12, 2025 02:54
@lidel
Copy link
Member Author

lidel commented Nov 16, 2025

@Brent-Sanchez are you sure you commented on correct PR? Confused that you mean by diagnostics. Both diagnostic screen in webui and telemetry in Kubo were documented in changelog and release notes and there is telemetry.md in docs directory as well, with instruction how to disable the telemetry. Hope this helps.

ps. Mind that commenting on closed PR is usually ignored, I've seen your question by sheer luck, next time open a topic in https://discuss.ipfs.tech/ :)

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

Successfully merging this pull request may close these issues.

gateway: range requests issue with big >5GiB files

4 participants