Streaming fails with "range not supported" error despite server supporting byte range requests
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- swift
- Domain
- networking
Research direction
Start with DefaultHTTPClient.swift, especially the logged request near line 388 and the range-support failure near line 441. Reproduce the issue using the provided publication URL and inspect how the response to the byte-range request is evaluated. Done means streaming succeeds when the server supports byte ranges, while unsupported servers still report the appropriate error.
Written by the indexing model from the issue text.
Description
Describe the bug
When attempting to stream a publication from the Readium publication server, the operation fails with a "range not supported" error, even though the server should support byte range requests. It work on kotlin-toolkit.
☝️ DefaultHTTPClient.swift:388: head https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json, headers: ["User-Agent": "BookWalker/0.0.0 iPhone17,3 iOS/18.5 CFNetwork/1.0 Darwin/24.5.0"]
☝️ DefaultHTTPClient.swift:388: get https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json, headers: ["User-Agent": "BookWalker/0.0.0 iPhone17,3 iOS/18.5 CFNetwork/1.0 Darwin/24.5.0"]
☝️ DefaultHTTPClient.swift:388: get https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json, headers: ["User-Agent": "BookWalker/0.0.0 iPhone17,3 iOS/18.5 CFNetwork/1.0 Darwin/24.5.0", "Range": "bytes=0-3"]
❌ DefaultHTTPClient.swift:441: Streaming ranges requires the remote HTTP server to support byte range requests: https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json
❌ DefaultHTTPClient.swift:408: get https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json failed with: - ReadiumShared.HTTPError.rangeNotSupported
Code:
let asset = try await readium.assetRetriever.retrieve(url: url).get()
let publication = try await readium.publicationOpener.open(
asset: asset,
allowUserInteraction: true,
credentials: credentials,
sender: nil
).get()
How to reproduce?
- Go to Readium Test App
- Import streaming publication: https://publication-server.readium.org/Z3M6Ly9yZWFkaXVtLXBsYXlncm91bmQtZmlsZXMvZGVtby9tb2J5LWRpY2suZXB1Yg/manifest.json
Readium version
3.3.0
OS version
iOS 18.5
Testing device
iPhone 16
Environment
macOS: 15.5
platform: arm64
carthage: 0.40.0
Xcode 16.3
Build version 16E140
Additional context
No response
- Dominant language
- Swift
- Stars
- 557
- Forks
- 249
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from readium/swift-toolkit
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
readium/swift-toolkit#954 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
readium/swift-toolkit#841 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
readium/swift-toolkit#961 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
readium/swift-toolkit#959 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
readium/swift-toolkit#953 ·
Maintainers usually reply within 1 day
All issues in readium/swift-toolkit
Similar issues
-
area: models enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rexmhall09/TUFF#69 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nikitabobko/AeroSpace#2427 · 1 comment ·
Maintainers usually reply within 8 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
A second click on the Control Center widget doesn't close Control CenterPossibly taken @MaHofseth claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100