changed decodeURI to decodeURIComponent

This commit is contained in:
shikhar-scs 2018-01-15 19:31:25 +05:30
parent 237bc2ef9d
commit 32080f1081

View File

@ -365,7 +365,7 @@ class PDFNodeStreamFsFullReader extends BaseFullReader {
constructor(stream) { constructor(stream) {
super(stream); super(stream);
let path = decodeURI(this._url.path); let path = decodeURIComponent(this._url.path);
// Remove the extra slash to get right path from url like `file:///C:/` // Remove the extra slash to get right path from url like `file:///C:/`
if (fileUriRegex.test(this._url.href)) { if (fileUriRegex.test(this._url.href)) {
@ -392,7 +392,7 @@ class PDFNodeStreamFsRangeReader extends BaseRangeReader {
constructor(stream, start, end) { constructor(stream, start, end) {
super(stream); super(stream);
let path = decodeURI(this._url.path); let path = decodeURIComponent(this._url.path);
// Remove the extra slash to get right path from url like `file:///C:/` // Remove the extra slash to get right path from url like `file:///C:/`
if (fileUriRegex.test(this._url.href)) { if (fileUriRegex.test(this._url.href)) {