Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Publication Fetcher tries loading .epub files as folders #202

@sscheidegger

Description

@sscheidegger

Using cloud-reader-lite v.0.31.1 trying to open a packaged .epub file results in an error message "Invalid / Corrupted EPUB". Console Output shows that readium recognizes the url to be a folder instead of a packaged file:
--- using PlainResourceFetcher

This is caused by an error in a Regex in js/epub-fetch/publication_fetcher.js on line 91:
return !(/.epub[3?]$/.test(uriTrimmed));

Correct Regex should be:
return !(/.epub[3]?$/.test(uriTrimmed));

This issue is a Bug

Expected Behaviour

Expect Ebok Urls ending on .epub to be handled as packaged EPub files and load them using ZipResourceFetcher.

Observed behaviour

Readium assumes Urls ending on .epub to be folders and tries loading them using PlainResourceFetcher, which fails.

Steps to reproduce

  1. Set up cloud-reader-lite v.0.31.1
  2. Put test.epub package in subfolder epub_content
  3. Load in Webbrowser using index.html?epub=epub_content/test.epub

Note: Problem does not occur if epub file is dragged and dropped into the browser/cloud reader.

Test file(s)

Reprocudible with any .epub file, for example moby dick

Product

  • Readium cloud reader app
    • latest development build of cloud-reader-lite
    • Firefox 81.0 (32bit)
    • Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions