Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be8683f556 | ||
|
|
c3450f4614 | ||
|
|
5881bc9ab0 |
No files matched your search
@@ -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.
|
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)
|
### [2.6.1](https://github.com/filebrowser/filebrowser/compare/v2.6.0...v2.6.1) (2020-07-28)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -99,13 +99,13 @@ export default {
|
|||||||
return (this.nextLink !== '')
|
return (this.nextLink !== '')
|
||||||
},
|
},
|
||||||
download () {
|
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 () {
|
previewUrl () {
|
||||||
if (this.req.type === 'image') {
|
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 () {
|
raw () {
|
||||||
return `${this.previewUrl}&inline=true`
|
return `${this.previewUrl}&inline=true`
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ function encodeRFC5987ValueChars(str) {
|
|||||||
replace(/%(?:7C|60|5E)/g, unescape);
|
replace(/%(?:7C|60|5E)/g, unescape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function encodePath(str) {
|
||||||
|
return str.split('/').map(v => encodeURIComponent(v)).join('/')
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
encodeRFC5987ValueChars: encodeRFC5987ValueChars,
|
encodeRFC5987ValueChars: encodeRFC5987ValueChars,
|
||||||
removeLastDir: removeLastDir
|
removeLastDir: removeLastDir,
|
||||||
|
encodePath: encodePath
|
||||||
}
|
}
|
||||||
+1
-1
@@ -189,7 +189,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use
|
|||||||
return http.StatusInternalServerError, err
|
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 {
|
if _, err := w.Write([]byte(signed)); err != nil {
|
||||||
return http.StatusInternalServerError, err
|
return http.StatusInternalServerError, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user