Changed getFile api call to always attach headers
Этот коммит содержится в:
@@ -130,7 +130,7 @@ class FileAttachment extends React.Component {
|
||||
var filename = this.props.filename;
|
||||
|
||||
var fileInfo = utils.splitFileLocation(filename);
|
||||
var fileUrl = utils.getFileUrl(filename, true);
|
||||
var fileUrl = utils.getFileUrl(filename);
|
||||
var type = utils.getFileType(fileInfo.ext);
|
||||
|
||||
var thumbnail;
|
||||
|
||||
@@ -228,7 +228,7 @@ class ViewImageModal extends React.Component {
|
||||
}
|
||||
|
||||
const filename = this.props.filenames[this.state.imgId];
|
||||
const fileUrl = Utils.getFileUrl(filename, true);
|
||||
const fileUrl = Utils.getFileUrl(filename);
|
||||
|
||||
var content;
|
||||
if (this.state.loaded[this.state.imgId]) {
|
||||
|
||||
@@ -1110,9 +1110,8 @@ export function fileSizeToString(bytes) {
|
||||
}
|
||||
|
||||
// Converts a filename (like those attached to Post objects) to a url that can be used to retrieve attachments from the server.
|
||||
export function getFileUrl(filename, isDownload) {
|
||||
const downloadParam = isDownload ? '?download=1' : '';
|
||||
return getWindowLocationOrigin() + '/api/v1/files/get' + filename + downloadParam;
|
||||
export function getFileUrl(filename) {
|
||||
return getWindowLocationOrigin() + '/api/v1/files/get' + filename;
|
||||
}
|
||||
|
||||
// Gets the name of a file (including extension) from a given url or file path.
|
||||
|
||||
Ссылка в новой задаче
Block a user