aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorUnpublished <unpublished@gmx.net>2021-02-22 15:59:26 +0100
committerJohn Molakvoæ (Rebase PR Action) <skjnldsv@users.noreply.github.com>2022-01-17 08:17:12 +0000
commit854890a7345788684764026922b2fd2f3e6bd573 (patch)
tree992db86db7ee3d622681b66e5b3455bcc5d6732a /apps
parent396e5cbebbcab67685315c1377067d1cc4a37add (diff)
downloadnextcloud-server-854890a7345788684764026922b2fd2f3e6bd573.tar.gz
nextcloud-server-854890a7345788684764026922b2fd2f3e6bd573.zip
Add X-Accel-Buffering header to downloads
Signed-off-by: Unpublished <unpublished@gmx.net>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php1
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php7
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 95f3db9a65b..1a27060eace 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -289,6 +289,7 @@ class FilesPlugin extends ServerPlugin {
$response->addHeader('OC-Checksum', $checksum);
}
}
+ $response->addHeader('X-Accel-Buffering', 'no');
}
/**
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index 201b2b863ab..777a730ffd1 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -590,9 +590,12 @@ class FilesPluginTest extends TestCase {
->willReturn($isClumsyAgent);
$response
- ->expects($this->once())
+ ->expects($this->exactly(2))
->method('addHeader')
- ->with('Content-Disposition', $contentDispositionHeader);
+ ->withConsecutive(
+ ['Content-Disposition', $contentDispositionHeader],
+ ['X-Accel-Buffering', 'no']
+ );
$this->plugin->httpGet($request, $response);
}