Add X-Accel-Buffering header to downloads
Signed-off-by: Unpublished <unpublished@gmx.net>
This commit is contained in:
parent
5ea903d824
commit
103efb11e9
|
@ -281,6 +281,7 @@ class FilesPlugin extends ServerPlugin {
|
|||
$response->addHeader('OC-Checksum', $checksum);
|
||||
}
|
||||
}
|
||||
$response->addHeader('X-Accel-Buffering', 'no');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue