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
- Set up cloud-reader-lite v.0.31.1
- Put test.epub package in subfolder epub_content
- 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