Skip to content

Commit

Permalink
fix: escape special characters in preview url (closes #1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
o1egl committed Jul 28, 2020
1 parent a722bcc commit c9340af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/files/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ export default {
return (this.nextLink !== '')
},
download () {
return `${baseURL}/api/raw${this.req.path}?auth=${this.jwt}`
return `${baseURL}/api/raw${escape(this.req.path)}?auth=${this.jwt}`
},
previewUrl () {
if (this.req.type === 'image') {
return `${baseURL}/api/preview/big${this.req.path}?auth=${this.jwt}`
return `${baseURL}/api/preview/big${escape(this.req.path)}?auth=${this.jwt}`
}
return `${baseURL}/api/raw${this.req.path}?auth=${this.jwt}`
return `${baseURL}/api/raw${escape(this.req.path)}?auth=${this.jwt}`
},
raw () {
return `${this.previewUrl}&inline=true`
Expand Down

0 comments on commit c9340af

Please sign in to comment.