Skip to content

Commit facf0ec

Browse files
committed
Merge pull request #4 from we-bridge/check_absolute_url
Check if the url is not absolute before appending a /
2 parents 927c7b1 + 11b144c commit facf0ec

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Resources/public/js/largefile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ var LargeFile = (function() {
115115
var container = document.getElementById(
116116
inputField.getAttribute('data-previewcontainer')
117117
);
118-
container.src = '/' + url;
118+
if (url.substring(0,1) !== '/') {
119+
url = '/' + url;
120+
}
121+
container.src = url;
119122

120123
if (container.load) {
121124
container.load();

0 commit comments

Comments
 (0)