Removed temporary fix for old filenames that used absolute urls pointing to the get file api

Этот коммит содержится в:
hmhealey
2016-01-06 09:54:05 -05:00
родитель 239d147d97
Коммит a6ba1a17fe
3 изменённых файлов: 3 добавлений и 26 удалений

Просмотреть файл

@@ -125,10 +125,6 @@ export default class FileAttachment extends React.Component {
getFileInfoFromName(name) {
var fileInfo = utils.splitFileLocation(name);
// This is a temporary patch to fix issue with old files using absolute paths
if (fileInfo.path.indexOf('/api/v1/files/get') !== -1) {
fileInfo.path = fileInfo.path.split('/api/v1/files/get')[1];
}
fileInfo.path = utils.getWindowLocationOrigin() + '/api/v1/files/get' + fileInfo.path;
return fileInfo;

Просмотреть файл

@@ -35,12 +35,7 @@ export default class FilePreview extends React.Component {
var ext = filenameSplit[filenameSplit.length - 1];
var type = Utils.getFileType(ext);
// This is a temporary patch to fix issue with old files using absolute paths
if (filename.indexOf('/api/v1/files/get') !== -1) {
filename = filename.split('/api/v1/files/get')[1];
}
filename = Utils.getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + Utils.getSessionIndex();
filename = Utils.getFileUrl(filename);
if (type === 'image') {
previews.push(