Skip to content

Fix #4615: Use downloadUrl for 'Open in browser' on public files#6133

Merged
dschmidt merged 1 commit into
masterfrom
fix_4615
Dec 13, 2021
Merged

Fix #4615: Use downloadUrl for 'Open in browser' on public files#6133
dschmidt merged 1 commit into
masterfrom
fix_4615

Conversation

@dschmidt
Copy link
Copy Markdown
Member

@dschmidt dschmidt commented Dec 11, 2021

Description

When #4615 was created, using "open in browser" on public links indeed resulted in the described behavior.
In #4689 the behavior was changed to open the download url in a new tab, that in turn did not open the file in the browser (for me, Chromium 95) but instead downloaded it with a random/hash filename.

The code path for private files achieves the correct result: it opens the file in a new tab and displays it.
We can align the behavior for public files with that by simply using the downloadUrl in the XHR download.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link
Copy Markdown

update-docs Bot commented Dec 11, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Copy Markdown
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing in some consistency 👍

},
methods: {
$_fetch_trigger({ resources, mimeType, isPublicFile }) {
let url;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter complained about this semicolon, you can just drop it

@ownclouders
Copy link
Copy Markdown
Contributor

Results for oCISRename https://drone.owncloud.com/owncloud/web/20940/53/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dschmidt dschmidt merged commit 074e049 into master Dec 13, 2021
@delete-merged-branch delete-merged-branch Bot deleted the fix_4615 branch December 13, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Cannot open the pdf file in the browser via public link Opening PDF from public link broken

3 participants