Add X-Accel-Buffering header to downloads

Signed-off-by: Unpublished <unpublished@gmx.net>
pull/25747/head
Unpublished 2021-02-22 15:59:26 +07:00 committed by John Molakvoæ (Rebase PR Action)
parent 396e5cbebb
commit 854890a734
4 changed files with 8 additions and 2 deletions

@ -289,6 +289,7 @@ class FilesPlugin extends ServerPlugin {
$response->addHeader('OC-Checksum', $checksum);
}
}
$response->addHeader('X-Accel-Buffering', 'no');
}
/**

@ -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);
}

@ -95,6 +95,7 @@ class Streamer {
* @param string $name
*/
public function sendHeaders($name) {
header('X-Accel-Buffering: no');
$extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar';
$fullName = $name . $extension;
$this->streamerInstance->sendHeaders($fullName);

@ -98,6 +98,7 @@ class OC_Files {
}
}
header('Content-Type: '.$type, true);
header('X-Accel-Buffering: no');
}
/**