readium / kotlin-toolkit

A toolkit for ebooks, audiobooks and comics written in Kotlin
https://readium.org/kotlin-toolkit
BSD 3-Clause "New" or "Revised" License
163 stars 72 forks source link

Fix sniffing media types when acquiring an LCP publication #518

Closed mickael-menu closed 2 months ago

mickael-menu commented 2 months ago

Some HTTP servers send wrong media types when downloading an LCP protected publication. For example returning application/epub+zip when downloading an LCPDF.

This failed the media type sniffing as we used both the license and HTTP server media types as hints.

Instead, now we use the license media type, and only the HTTP server media type as a fallback when missing.