Skip to content

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

@sysint64

Description

@sysint64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions