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

Abierto
#653 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@mickael-menu ya está trabajando en esto.

Desde el 17/7/2026.

  • #864 de @mickael-menu — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
swift
Área
networking

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Swift
Estrellas
557
Forks
249
Merge medio
3 h 52 min
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de readium/swift-toolkit

Todos los issues de readium/swift-toolkit

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.