From 73ee387319d59dca073e4cd0c1b9b60b392b137d Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 21 Jul 2015 17:49:08 -0400 Subject: Fixing issues with files trasitioning to relative paths --- web/react/components/file_preview.jsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/react/components') diff --git a/web/react/components/file_preview.jsx b/web/react/components/file_preview.jsx index 553293d2b..e69607206 100644 --- a/web/react/components/file_preview.jsx +++ b/web/react/components/file_preview.jsx @@ -19,6 +19,10 @@ module.exports = React.createClass({ var filenameSplit = filename.split('.'); 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 = window.location.origin + "/api/v1/files/get" + filename; if (type === "image") { -- cgit v1.2.3-1-g7c22