Streaming fails with "range not supported" error despite server supporting byte range requests

Aperta
#653 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mickael-menu ci sta già lavorando.

Dal 17/7/2026.

  • #864 di @mickael-menu — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
swift
Ambito
networking

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?
  1. Go to Readium Test App
  2. 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

Lingua principale
Swift
Stelle
557
Fork
249
Merge medio
3h 52m
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di readium/swift-toolkit

Tutte le issue di readium/swift-toolkit

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.