Skip to content

Commit

Permalink
Merge pull request #26 from gmartin7/BL-12852Plus
Browse files Browse the repository at this point in the history
BL-12852 Deal with + in sub filenames (#26)

Co-Authored-By: Gordon Martin <[email protected]>
  • Loading branch information
andrew-polk and Gordon Martin authored Nov 13, 2023
2 parents 2b216b7 + 3109840 commit 87e0264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bloompub-viewer",
"version": "1.0.3",
"version": "1.0.4",
"author": "Bloom Devs",
"description": "Viewer for Bloom Digital books",
"license": "MIT",
Expand Down
9 changes: 5 additions & 4 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ let currentFolder: string;
function convertUrlToPath(requestUrl: string): string {
// console.log(`convertUrlToPath: requestUrl=${requestUrl}`);

const bloomPlayerOrigin = "bpub://bloom-player/";
const baseUrl = decodeURI(requestUrl);
const urlPrefix = "bpub://";
const bloomPlayerOrigin = urlPrefix + "bloom-player/";
const baseUrl = decodeURIComponent(requestUrl);
const urlPath = baseUrl.startsWith(bloomPlayerOrigin)
? baseUrl.substr(bloomPlayerOrigin.length)
: baseUrl.substr(7); // not from same origin? shouldn't happen.
? baseUrl.substring(bloomPlayerOrigin.length)
: baseUrl.substring(urlPrefix.length); // not from same origin? shouldn't happen.
const playerFolder =
process.env.NODE_ENV === "development"
? Path.normalize(
Expand Down

0 comments on commit 87e0264

Please sign in to comment.