Compare commits

..

3 Commits

Author SHA1 Message Date
Oleg Lobanov
be8683f556 chore(release): 2.6.2 2020-08-05 11:55:16 +02:00
Davide Maggio
c3450f4614 chore: return text/plain header in auth response (#1051) 2020-08-05 10:48:03 +02:00
Oleg Lobanov
5881bc9ab0 chore: fix preview of files with non-latin names (closes #1056) 2020-08-05 10:40:03 +02:00
4 changed files with 12 additions and 5 deletions

View File

@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.6.2](https://github.com/filebrowser/filebrowser/compare/v2.6.1...v2.6.2) (2020-08-05)
### [2.6.1](https://github.com/filebrowser/filebrowser/compare/v2.6.0...v2.6.1) (2020-07-28)

View File

@@ -99,13 +99,13 @@ export default {
return (this.nextLink !== '')
},
download () {
return `${baseURL}/api/raw${escape(this.req.path)}?auth=${this.jwt}`
return `${baseURL}/api/raw${url.encodePath(this.req.path)}?auth=${this.jwt}`
},
previewUrl () {
if (this.req.type === 'image') {
return `${baseURL}/api/preview/big${escape(this.req.path)}?auth=${this.jwt}`
return `${baseURL}/api/preview/big${url.encodePath(this.req.path)}?auth=${this.jwt}`
}
return `${baseURL}/api/raw${escape(this.req.path)}?auth=${this.jwt}`
return `${baseURL}/api/raw${url.encodePath(this.req.path)}?auth=${this.jwt}`
},
raw () {
return `${this.previewUrl}&inline=true`

View File

@@ -20,7 +20,12 @@ function encodeRFC5987ValueChars(str) {
replace(/%(?:7C|60|5E)/g, unescape);
}
function encodePath(str) {
return str.split('/').map(v => encodeURIComponent(v)).join('/')
}
export default {
encodeRFC5987ValueChars: encodeRFC5987ValueChars,
removeLastDir: removeLastDir
removeLastDir: removeLastDir,
encodePath: encodePath
}

View File

@@ -189,7 +189,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
return http.StatusInternalServerError, err
}
w.Header().Set("Content-Type", "cty")
w.Header().Set("Content-Type", "text/plain")
if _, err := w.Write([]byte(signed)); err != nil {
return http.StatusInternalServerError, err
}