]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use webDAV to have access to HTTP byte ranges
authorOlivier Paroz <github@oparoz.com>
Thu, 16 Apr 2015 17:46:26 +0000 (19:46 +0200)
committerOlivier Paroz <github@oparoz.com>
Thu, 23 Apr 2015 16:19:17 +0000 (18:19 +0200)
apps/files_sharing/js/public.js

index cfb6569529f065e3e86ccee35915e7d18aa26bc4..f80d5e15de9b8c04760a19b8ca63e457b490f340 100644 (file)
@@ -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');