Skip to content
Snippets Groups Projects
Commit e86ea950 authored by Joas Schilling's avatar Joas Schilling Committed by GitHub
Browse files

Merge pull request #2404 from nextcloud/streamresponse-warning

prevent warning in StreamResponse
parents f9271ebb 72a54ff9
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ class StreamResponse extends Response implements ICallbackResponse { ...@@ -54,7 +54,7 @@ class StreamResponse extends Response implements ICallbackResponse {
public function callback (IOutput $output) { public function callback (IOutput $output) {
// handle caching // handle caching
if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) { if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) {
if (!(file_exists($this->filePath) || is_resource($this->filePath))) { if (!(is_resource($this->filePath) || file_exists($this->filePath))) {
$output->setHttpResponseCode(Http::STATUS_NOT_FOUND); $output->setHttpResponseCode(Http::STATUS_NOT_FOUND);
} elseif ($output->setReadfile($this->filePath) === false) { } elseif ($output->setReadfile($this->filePath) === false) {
$output->setHttpResponseCode(Http::STATUS_BAD_REQUEST); $output->setHttpResponseCode(Http::STATUS_BAD_REQUEST);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment