diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-21 14:21:53 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-21 14:21:53 -0800 |
commit | 26010e2690c251ef1424d7ad4037efbff5ac8901 (patch) | |
tree | 5f03802e4beca63ae3b175bab20e50e3afd2d956 /web/react | |
parent | 384223a3e7fe6350e6087849fcc1f75923cc80c9 (diff) | |
parent | 73ee387319d59dca073e4cd0c1b9b60b392b137d (diff) | |
download | chat-26010e2690c251ef1424d7ad4037efbff5ac8901.tar.gz chat-26010e2690c251ef1424d7ad4037efbff5ac8901.tar.bz2 chat-26010e2690c251ef1424d7ad4037efbff5ac8901.zip |
Merge pull request #225 from mattermost/files-patch
Fixing issues with files trasitioning to relative paths
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/file_preview.jsx | 4 |
1 files changed, 4 insertions, 0 deletions
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") { |