Fix #299 Decode URL twice to fix PDF refresh problem

This commit is contained in:
James-Yu 2017-11-06 12:15:38 +08:00
parent dc18c39298
commit 4c8d39cada
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# Change Log
## [3.6.1] - Unreleased
## [3.6.1] - 2017-11-06
### Fixed
- (#297) PDF path can contain `#` now.

View File

@ -35,7 +35,7 @@ export class Server {
if (!request.url) {
return
}
request.url = decodeURIComponent(request.url)
request.url = decodeURIComponent(decodeURIComponent(request.url))
if (request.url.indexOf('pdf:') >= 0 && request.url.indexOf('viewer.html') < 0) {
// The second backslash was encoded as %2F, and the first one is prepended by request
const fileName = request.url.replace('//pdf:', '')