Add X-Accel-Buffering header to downloads

Signed-off-by: Unpublished <unpublished@gmx.net>
This commit is contained in:
Unpublished 2021-02-22 15:59:26 +01:00
parent 5ea903d824
commit 103efb11e9
4 changed files with 8 additions and 2 deletions

View File

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

View File

@ -576,9 +576,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);
}

View File

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

View File

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