Cloudflare CDN 会转移范围请求的响应数据
作者: lukebrody创建于 2026年2月21日更新于 2026年7月8日
标签in progress
Description
When jsdelivr uses the Cloudflare CDN, range requests are served incorrectly. The data is shifted to the right by 4 bytes.
Affected jsDelivr links
Correct Response
curl -s \
'https://cdn.jsdelivr.net/gh/densitydb/densitydb.GitHub.io@96c5d0cf96cd2fdf57f3e95d642e931e699777e3/data/07%2F9.blob' \
-H 'range: bytes=122102-140043' \
--connect-to cdn.jsdelivr.net::jsdelivr.map.fastly.net: \
| xxd -l 32
00000000: 1f8b 0808 0000 0000 02ff 4e65 7720 596f ..........New Yo
00000010: 726b 2063 6974 792c 204e 6577 2059 6f72 rk city, New Yor
## Incorrect Response
(`db3e 0000` are the previous bytes in the file) curl -s
'https://cdn.jsdelivr.net/gh/densitydb/densitydb.GitHub.io@96c5d0cf96cd2fdf57f3e95d642e931e699777e3/data/07%2F9.blob'
-H 'range: bytes=122102-140043'
--connect-to cdn.jsdelivr.net::cdn.jsdelivr.net.cdn.Cloudflare.net:
| xxd -l 32
00000000: db3e 0000 1f8b 0808 0000 0000 02ff 4e65 .>............Ne
00000010: 7720 596f 726b 2063 6974 792c 204e 6577 w York city, New
Response headers
Correct Response
with byte count to show shift
curl -v \
'https://cdn.jsdelivr.net/gh/densitydb/densitydb.GitHub.io@96c5d0cf96cd2fdf57f3e95d642e931e699777e3/data/07%2F9.blob' \
-H 'range: bytes=122102-140043' \
--connect-to cdn.jsdelivr.net::jsdelivr.map.fastly.net: \
| wc -c
* Connecting to hostname: jsdelivr.map.fastly.net
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host jsdelivr.map.fastly.net:443 was resolved.
* IPv6: (none)
* IPv4: 151.101.65.229, 151.101.129.229, 151.101.193.229, 151.101.1.229
* Trying 151.101.65.229:443...
* Connected to jsdelivr.map.fastly.net (151.101.65.229) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
} [321 bytes data]
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* (304) (IN), TLS handshake, Unknown (8):
{ [19 bytes data]
* (304) (IN), TLS handshake, Certificate (11):
{ [2837 bytes data]
* (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* (304) (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* (304) (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
* subject: CN=jsdelivr.net
* start date: Jun 2 15:43:52 2025 GMT
* expire date: Jul 4 15:43:51 2026 GMT
* subjectAltName: host "cdn.jsdelivr.net" matched cert's "*.jsdelivr.net"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Atlas R3 DV TLS CA 2025 Q2
* SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for
…内容来源: jsdelivr/jsdelivr