1. Introduction

A Range request asks for part of a file: bytes=0-1023 for the first kilobyte, bytes=1000- to resume, bytes=-500 for the last 500 bytes. Download managers, media players, crawlers and AI agents that fetch large artefacts all rely on it, and most servers answer it through a framework’s static-file helper. RFC 9110 Section 14 [1] is permissive in places (a server MAY ignore Range, MAY ignore an invalid range set, MAY coalesce or reject many overlapping ranges) and firm in others. A suffix longer than the file selects the whole file, a server MUST ignore an unknown range unit, and unit names are case-insensitive. We ask: given byte-identical requests for one 100-byte file, which status and which bytes does each of seven common static-file paths return?

T-Reqs [3], HDiff [4] and the HTTP Garden [5] use differential testing [2] to find framing, Host and cache-poisoning discrepancies between HTTP servers and proxies; none reports Range interpretation. CornerCase [11] derives boundary tests from RFCs with an LLM and runs them across nginx, Apache, Caddy, H2O and lighttpd; its reported HTTP findings concern Host headers and percent-encoded null bytes, not Range. RangeAmp [6] measured how 13 CDNs forward Range headers (lazy, delete, expand) and built amplification attacks. That is forwarding policy, not origin parsing. Rautenstrauch and Stock [7] tested nine servers against 106 HTTP rules. Their released suite checks Content-Range grammar and 206/416 headers with one fixed probe (bytes=0-10), not how different Range values are read. Single-implementation reports exist [8, 9]. We found no published matrix that sends one shared set of Range headers to several framework file servers and compares the bytes served.

3. Method

Subjects (defaults throughout). Express 5.3.0 res.sendFile (send 1.2.1, range-parser 1.3.0); @fastify/send 4.2.1, the engine of @fastify/static, with its own parser; Starlette 1.10.0 FileResponse (the FastAPI path) under uvicorn 0.54.0; aiohttp 3.14.5 web.FileResponse; Werkzeug 3.1.9 send_file(conditional=True) (the Flask path); Tornado 6.6.1 StaticFileHandler; and Go 1.27.3 http.ServeContent (behind http.FileServer), built with a go 1.27 directive. Node v24.22.1, CPython 3.13.5. We left out PyPI httprange, a standalone parser with no server integration.

Harness. The file r100.txt holds 0123456789 ten times, and r0.txt is empty. run_all.sh starts the seven servers on 127.0.0.1 and stops them on exit. driver.py sends each case as identical raw bytes (GET, Host, Range, Connection: close). It normalises the response to 206 a-b (checking the body equals bytes a..b), 206 m[...] (multipart, every part parsed), 200 (full file), 416 or 400. Malformed Content-Range values are kept verbatim.

Classification (analyze.py, strict reading of RFC 9110). A is the prescribed outcome. P is a permitted alternative: 200 ignoring Range, coalescing, or 416 for excessive or overlapping sets. L is a lenient 206 for invalid syntax. R is a 400/416 for invalid syntax; the RFC says such a header MAY be ignored, and 416 is defined for unsatisfiable or excessive sets. X departs from the RFC: 416 to a satisfiable valid request, 206 to an unsatisfiable one, a non-200 answer to an unknown unit, or a malformed Content-Range.

Reproduce.

git clone https://github.com/buildngrowsv/pubroot-pilots && cd pubroot-pilots
git checkout 2f3875406c7369004375d6e117de037a27af15e5
cd range-parsers/js && npm ci && cd ..
python3 -m venv .venv && .venv/bin/pip install -r py/requirements.txt
PY=.venv/bin/python ./run_all.sh

Folder: https://github.com/buildngrowsv/pubroot-[REDACTED_SECRET]-parsers/

Two runs in the working tree and a third from a git archive export with fresh npm ci/pip install produced byte-identical results/ files.

4. Results

The servers disagreed on 48 of 58 cases, with up to five distinct outcomes for one header. All seven agreed on only ten simple cases. Class counts (A/P/L/R/X): Express 40/12/3/1/2, @fastify/send 29/10/11/6/2, Starlette 36/1/5/14/2, aiohttp 23/3/0/19/13, Werkzeug 20/5/3/16/14, Tornado 27/23/6/2/0, Go 30/2/3/15/8. Pairwise differences ranged from 10 cases (aiohttp–Werkzeug) to 44 (Tornado–Go).

Long suffix (R08, R52). For bytes=-200 on 100 bytes, Starlette, aiohttp and Go sent 206 0-99, and Tornado sent 200. Express, @fastify/send and Werkzeug sent 416. All three compute the start as 100 - 200 = -100 and drop the range. With a 20-digit suffix, Go also sent 416, because strconv.ParseInt overflows.

Zero-length suffix and empty file (R14, R55–R58). bytes=-0 is unsatisfiable. aiohttp served the whole file. Go sent 206 with Content-Range: bytes 100-99/100, and on the empty file it sent bytes 0--1/0 for bytes=-1 and bytes=-0. Neither value matches the Content-Range grammar. Go’s suffix branch sets the length to 0, and its formatter prints start-(start+length-1).

Multiple ranges (R24–R33, R41–R45). The servers follow four policies. Starlette (sorted, merged) and Go (request order, unmerged) send multipart. Express and @fastify/send merge overlapping or adjacent ranges and otherwise ignore the header. Tornado always ignores it. aiohttp and Werkzeug answer 416 even to bytes=0-9,20-29. Starlette also sent 416 when one of two ranges was satisfiable (R28).

Units (R34–R36). For Bytes=0-9, Starlette, aiohttp and Werkzeug served 206 0-9, Express, @fastify/send and Tornado ignored the header, and Go sent 416. For items=0-9, which a server MUST ignore, only Express, @fastify/send and Tornado complied. The other four answered 400 or 416.

Malformed syntax and numerals. Express ignored nearly every malformed header with 200. The others mixed 400, 416 and lenient reads. @fastify/send parses each number with parseInt and keeps the numeric prefix, so 0x0-0x9 became bytes 0–0, 1e1-19 and 1_0-19 became 1–19, and -5-10 became 95–99. Python’s int() accepts digit underscores (the cause of HTTP Garden’s chunk-size bugs [5]), so Starlette and Tornado served 10–19 for 1_0-19. Tornado read --5 as 5–99. Spaces inside the set (bytes= 0-9, bytes=0 - 9) were accepted by every server except aiohttp.

Go’s range cap depends on the module directive. Go’s httpservecontentmaxranges GODEBUG setting has an old value of 1 for modules declaring a Go version before 1.26. Our first build used go 1.22 and ignored every multi-range header. The pilot records a separate run with GODEBUG=httpservecontentmaxranges=1, which changes 15 cases (R24–R33, R41–R45).

5. Real-world sample and a packaging finding

R10 is a real header from a public tower-http issue [8]: a link-preview crawler sends bytes=0-3145727 on every request. Six servers served our file with 206 0-99 and Tornado with 200. The issue reports that tower-http answered 416, which the crawler treated as failure.

While tracing R08 we compared the installed range-parser with its repository [10]. Git tag v1.3.0 points to the merge of #66, “Clamp a suffix whose length exceeds the representation” (2026-06-25), whose index.js uses Math.max(size - end, 0). The npm tarball of range-parser 1.3.0 (sha256 51b79ec0…0fae) records gitHead 855f5b1f. That is a version-bump commit on an older parent, without #63 or #66, and parse(100, "bytes=-200") still returns -1. Express’s R08 behaviour therefore comes from the published package, not from the tagged source. We observed this on 2026-11-11 and did not contact the maintainers.

6. Implications (hypotheses)

Hypothesis: a downloader asking for a long suffix of a small file will read 416 from Express, Fastify or Flask as “nothing to fetch”, while FastAPI, aiohttp and Go return the file. Hypothesis: a client sending multi-range requests must handle 200, 206 single, 206 multipart and 416. Hypothesis: a cache and an origin that read numerals differently (parseInt prefix versus int() underscores) could disagree about which bytes a stored partial response holds. We tested no proxy chain.

7. Threats to validity

  • Synthetic cases. 57 of 58 headers are ours; they show that behaviours differ, not how often each header occurs.
  • Scope. GET only, one 100-byte file plus an empty file; no HEAD, If-Range, large files or compression.
  • Front ends. Each server’s HTTP parser sits before its range logic, so some outcomes (for example Starlette’s 400) may come from the framework layer. We report what a deployer sees.
  • Classification. The classes are our reading of RFC 9110; the raw outcomes in Appendix B do not depend on them.
  • Versions. One version per library. Go also depends on its module directive, and range-parser’s repository already has the suffix fix.

8. Conclusion

Seven common static-file paths gave different answers to 48 of 58 Range headers. Some of these cases are fixed by the RFC: three servers answer 416 to a long suffix, four reject an unknown unit, and Go emits malformed Content-Range values. Clients should expect 200, 206 single, 206 multipart and 416, avoid long suffixes and multi-range requests, and check Content-Range before trusting the bytes. Server authors can reuse the case set as a regression suite.

Appendix A–B. Cases and full verdict matrix

Requests are GET /r100.txt (100 bytes) unless marked “(0 B)” (empty file). 206 a-b is one part, 206 m[...] is multipart in served order, 200 is the full file, 416 carries Content-Range: bytes */size, 416† lacks Content-Range, and 400 is Bad Request. Cells without a letter are class A; otherwise the letter gives the class (§3). “Expected” is the A outcome.

Unanimous cases (all seven gave the expected outcome): R01 bytes=0-9 → 206 0-9; R02 bytes=10-19 → 206 10-19; R03 bytes=0-0 → 206 0-0; R04 bytes=99-99 → 206 99-99; R05 bytes=50- → 206 50-99; R06 bytes=-10 → 206 90-99; R11 bytes=100- → 416; R12 bytes=100-150 → 416; R13 bytes=200-300 → 416; R48 bytes=00-09 → 206 0-9.

Disagreeing cases:

#Range (size)Expected (RFC 9110)Express@fastify/sendStarletteaiohttpWerkzeugTornadoGo
R07bytes=-100206 0-99206 0-99206 0-99206 0-99206 0-99206 0-99200 P206 0-99
R08bytes=-200206 0-99416 X416 X206 0-99206 0-99416 X200 P206 0-99
R09bytes=0-199206 0-99206 0-99206 0-99206 0-99206 0-99206 0-99200 P206 0-99
R10bytes=0-3145727206 0-99206 0-99206 0-99206 0-99206 0-99206 0-99200 P206 0-99
R14bytes=-0416416416416206 0-99 X416416206 bytes 100-99/100 X
R15bytes=10-5200416 R416 R400 R416 R416 R416 R416† R
R16bytes=200200416 R400 R416 R416 R200200
R17bytes=-200200416 R400 R416 R416 R200416† R
R18bytes=abc200200416 R400 R416 R416 R200416† R
R19bytes=--5200200416 R416 R416 R416 R206 5-99 L416† R
R20bytes=5--10200200416 R400 R416 R416 R416 R416† R
R21bytes=-5-10200200206 95-99 L400 R416 R416 R200416† R
R22bytes=0-9;x200200206 0-9 L400 R416 R416 R200416† R
R23bytes=0-9x200200206 0-9 L400 R416 R416 R200416† R
R24bytes=0-9,20-29206 m[0-9,20-29]200 P200 P206 m[0-9,20-29]416 X416 X200 P206 m[0-9,20-29]
R25bytes=0-9,5-14206 0-14 or 206 m[0-9,5-14]206 0-14206 0-14206 0-14416 X416 X200 P206 m[0-9,5-14]
R26bytes=0-9,10-19206 0-19 or 206 m[0-9,10-19]206 0-19206 0-19206 0-19416 X416 X200 P206 m[0-9,10-19]
R27bytes=20-29,0-9206 m[0-9,20-29] or 206 m[20-29,0-9]200 P200 P206 m[0-9,20-29]416 X416 X200 P206 m[20-29,0-9]
R28bytes=0-9,200-300206 0-9206 0-9206 0-9416 X416 X416 X200 P206 0-9
R29bytes=200-300,300-400416416416416416416200 P416
R30bytes=0-9,10-5200206 0-9 L206 0-9 L400 R416 R416 R200416† R
R31bytes=0-9,0-9,0-9206 0-9 or 206 m[0-9,0-9,0-9]206 0-9206 0-9206 0-9416 P416 P200 P206 m[0-9,0-9,0-9]
R32bytes=-10,0-9206 m[0-9,90-99] or 206 m[90-99,0-9]200 P200 P206 m[0-9,90-99]416 X416 X200 P206 m[90-99,0-9]
R33bytes=0-0,2-2,…,38-38 (20)206 m[20 parts]200 P200 P206 m[20 parts]416 P416 P200 P206 m[20 parts]
R34Bytes=0-9206 0-9200 P200 P206 0-9206 0-9206 0-9200 P416† X
R35BYTES=0-9206 0-9200 P200 P206 0-9206 0-9206 0-9200 P416† X
R36items=0-9200200200400 X416 X416 X200416† X
R37bytes 0-9200200200400 R416 R416 R200416† R
R38bytes = 0-9200200200206 0-9 L416 R206 0-9 L206 0-9 L416† R
R39bytes= 0-9200206 0-9 L206 0-9 L206 0-9 L416 R206 0-9 L206 0-9 L206 0-9 L
R40bytes=0 - 9200206 0-9 L206 0-9 L206 0-9 L416 R206 0-9 L206 0-9 L206 0-9 L
R41bytes=0-9, 20-29206 m[0-9,20-29]200 P200 P206 m[0-9,20-29]416 X416 X200 P206 m[0-9,20-29]
R42bytes=0-9 ,20-29206 m[0-9,20-29]200 P200 P206 m[0-9,20-29]416 X416 X200 P206 m[0-9,20-29]
R43bytes=0-9,,20-29206 m[0-9,20-29]200 P200 P206 m[0-9,20-29]416 X416 X200 P206 m[0-9,20-29]
R44bytes=0-9,206 0-9200 P206 0-9206 0-9416 X416 X200 P206 0-9
R45bytes=,0-9206 0-9200 P206 0-9206 0-9416 X416 X200 P206 0-9
R46bytes=+0-9200200206 0-9 L206 0-9 L416 R416 R206 0-9 L206 0-9 L
R47bytes=0x0-0x9200200206 0-0 L400 R416 R416 R200416† R
R49bytes=1_0-19200200206 1-19 L206 10-19 L416 R416 R206 10-19 L416† R
R50bytes=0-99999999999999999999206 0-99206 0-99206 0-99206 0-99206 0-99206 0-99200 P416† X
R51bytes=99999999999999999999-416416416416416416416416†
R52bytes=-99999999999999999999206 0-99416 X416 X206 0-99206 0-99416 X200 P416† X
R53bytes=0.0-9200200206 0-9 L400 R416 R416 R200416† R
R54bytes=1e1-19200200206 1-19 L400 R416 R416 R200416† R
R55bytes=0-0 (0 B)416416416416416200 P416200 P
R56bytes=0- (0 B)416416416416416200 P416200 P
R57bytes=-1 (0 B)200416 P416 P416 P416 P200416 P206 bytes 0--1/0 X
R58bytes=-0 (0 B)416416416416416200 P416206 bytes 0--1/0 X

References

  1. R. Fielding, M. Nottingham, J. Reschke. RFC 9110: HTTP Semantics, Section 14 (Range Requests). 2022. https://www.rfc-editor.org/rfc/rfc9110#section-14
  2. W. M. McKeeman. Differential Testing for Software. Digital Technical Journal 10(1), 1998.
  3. B. Jabiyev, S. Sprecher, K. Onarlioglu, E. Kirda. T-Reqs: HTTP Request Smuggling with Differential Fuzzing. ACM CCS 2021.
  4. K. Shen et al. HDiff: A Semi-automatic Framework for Discovering Semantic Gap Attack in HTTP Implementations. IEEE/IFIP DSN 2022. https://doi.org/10.1109/dsn53405.2022.00014
  5. B. Kallus, P. Anantharaman, M. E. Locasto, S. W. Smith. The HTTP Garden: Discovering Parsing Vulnerabilities in HTTP/1.1 Implementations by Differential Fuzzing of Request Streams. arXiv:2405.17737, 2024.
  6. W. Li, K. Shen, R. Guo, B. Liu, J. Zhang, H. Duan, S. Hao, X. Chen, Y. Wang. CDN Backfired: Amplification Attacks Based on HTTP Range Requests. IEEE/IFIP DSN 2020. https://doi.org/10.1109/dsn48063.2020.00022
  7. J. Rautenstrauch, B. Stock. Who’s Breaking the Rules? Studying Conformance to the HTTP Specifications and its Security Impact. ACM AsiaCCS 2024. https://doi.org/10.1145/3634737.3637678 (test suite: https://doi.org/10.5281/zenodo.21389441)
  8. tower-rs/tower-http issue #384: “ServeDir: requests that ask for a range that extends past the end of a document return a 416 response”. https://github.com/tower-rs/tower-http/issues/384
  9. static-web-server pull request #669: “Improve byte-range suffix detection and extract normalization helpers”. https://github.com/static-web-server/static-web-server/pull/669
  10. jshttp/range-parser: tag v1.3.0 and pull request #66. https://github.com/jshttp/range-parser/pull/66 ; npm package range-parser 1.3.0, https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz
  11. R. Singha, K. Qian, S. Saikrishnan, T. Zhao, S. Abbasloo, R. Beckett, S. K. R. Kakarla, T. D. Millstein, G. Varghese. CornerCase: Automated Extremal Testing of Protocol Implementations using LLMs. arXiv:2606.29124, 2026.