summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-04-16 19:46:26 +0200
committerOlivier Paroz <github@oparoz.com>2015-04-23 18:19:17 +0200
commit530c290555cb326e6a6bda867e16931ff4ae7df5 (patch)
treec2674b06b481ecf5823adc21f9d64d3f8536a6bc /apps/files_sharing/js
parente113d67430c0433e96c0de83e989bd6284fd0d63 (diff)
downloadnextcloud-server-530c290555cb326e6a6bda867e16931ff4ae7df5.tar.gz
nextcloud-server-530c290555cb326e6a6bda867e16931ff4ae7df5.zip
Use webDAV to have access to HTTP byte ranges
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/public.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index cfb6569529f..f80d5e15de9 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -111,8 +111,11 @@ OCA.Sharing.PublicApp = {
img.attr('src', $('#downloadURL').val());
img.appendTo('#imgframe');
} else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text') {
+ // Undocumented Url to public WebDAV endpoint
+ var url = parent.location.protocol + '//' +
+ token + '@' + location.host + OC.linkTo('', 'public.php/webdav');
$.ajax({
- url: $('#downloadURL').val(),
+ url: url,
headers: {Range: "bytes=0-1000"}
}).then(function (data) {
var textDiv = $('<span/>').addClass('text-preview');