Fix viewing PDF files with public share links #309
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #286, users have reported that PDF files
are not viewable via public share links. The issue was introduced in
c992b55 when attempting to encode parts of the URL for files that
have special characters.
This patch uses the URL Web API to deal with the parts of the URL
in a more specific way. Also, the path and files searchParams are
set based on
this.filename
andthis.basename
in the same wayit is done in the View module when setting
davPath
.This has been tested on private and shared public links on files
with and without special characters.