From: Olivier Paroz Date: Thu, 16 Apr 2015 17:46:26 +0000 (+0200) Subject: Use webDAV to have access to HTTP byte ranges X-Git-Tag: v8.1.0beta1~36^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=530c290555cb326e6a6bda867e16931ff4ae7df5;p=nextcloud-server.git Use webDAV to have access to HTTP byte ranges --- 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 = $('').addClass('text-preview');