diff options
author | Robin Appelman <robin@icewind.nl> | 2016-11-18 14:55:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-18 14:55:07 +0100 |
commit | 8b9ad46ba3ef876f00dc6bdadd7b51d7b1fa1c78 (patch) | |
tree | bc9c6a21ddc68656d8fd93c67f11b754a358afdb /lib/public/AppFramework/Http | |
parent | 6c11c54434b29bb9f7f07ba9a8070ed8308bc5a4 (diff) | |
parent | 4ac5fdcf11b0ca7dd985d50a91393a1c185821ff (diff) | |
download | nextcloud-server-8b9ad46ba3ef876f00dc6bdadd7b51d7b1fa1c78.tar.gz nextcloud-server-8b9ad46ba3ef876f00dc6bdadd7b51d7b1fa1c78.zip |
Merge pull request #768 from nextcloud/s3-objectstore
Add S3 objectstore backend
Diffstat (limited to 'lib/public/AppFramework/Http')
-rw-r--r-- | lib/public/AppFramework/Http/IOutput.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/StreamResponse.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/public/AppFramework/Http/IOutput.php b/lib/public/AppFramework/Http/IOutput.php index 1544c7d6375..642bcf4170f 100644 --- a/lib/public/AppFramework/Http/IOutput.php +++ b/lib/public/AppFramework/Http/IOutput.php @@ -39,7 +39,7 @@ interface IOutput { public function setOutput($out); /** - * @param string $path + * @param string|resource $path or file handle * * @return bool false if an error occurred * @since 8.1.0 diff --git a/lib/public/AppFramework/Http/StreamResponse.php b/lib/public/AppFramework/Http/StreamResponse.php index b5852fb5620..e124bb4ccbf 100644 --- a/lib/public/AppFramework/Http/StreamResponse.php +++ b/lib/public/AppFramework/Http/StreamResponse.php @@ -37,7 +37,7 @@ class StreamResponse extends Response implements ICallbackResponse { private $filePath; /** - * @param string $filePath the path to the file which should be streamed + * @param string|resource $filePath the path to the file or a file handle which should be streamed * @since 8.1.0 */ public function __construct ($filePath) { @@ -54,7 +54,7 @@ class StreamResponse extends Response implements ICallbackResponse { public function callback (IOutput $output) { // handle caching if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) { - if (!file_exists($this->filePath)) { + if (!(file_exists($this->filePath) || is_resource($this->filePath))) { $output->setHttpResponseCode(Http::STATUS_NOT_FOUND); } elseif ($output->setReadfile($this->filePath) === false) { $output->setHttpResponseCode(Http::STATUS_BAD_REQUEST); |