diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-06-26 10:32:50 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-06-26 16:14:15 +0200 |
commit | 79d9841bce94c0e9abf5e53c845236296a8999de (patch) | |
tree | b676ba133dbf68ad0d64ba21bf192bdb4308294a /lib/private/legacy/files.php | |
parent | d9d557a5ef31d63a8807feac1c530c36a077607f (diff) | |
download | nextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.tar.gz nextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.zip |
Replace hardcoded status headers with calls to http_response_code()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/legacy/files.php')
-rw-r--r-- | lib/private/legacy/files.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php index f4474197d86..159e18c7754 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -83,7 +83,7 @@ class OC_Files { $type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); if ($fileSize > -1) { if (!empty($rangeArray)) { - header('HTTP/1.1 206 Partial Content', true); + http_response_code(206); header('Accept-Ranges: bytes', true); if (count($rangeArray) > 1) { $type = 'multipart/byteranges; boundary='.self::getBoundary(); @@ -286,12 +286,12 @@ class OC_Files { if (\OC\Files\Filesystem::isReadable($filename)) { self::sendHeaders($filename, $name, $rangeArray); } elseif (!\OC\Files\Filesystem::file_exists($filename)) { - header("HTTP/1.1 404 Not Found"); + http_response_code(404); $tmpl = new OC_Template('', '404', 'guest'); $tmpl->printPage(); exit(); } else { - header("HTTP/1.1 403 Forbidden"); + http_response_code(403); die('403 Forbidden'); } if (isset($params['head']) && $params['head']) { @@ -321,7 +321,7 @@ class OC_Files { // file is unseekable header_remove('Accept-Ranges'); header_remove('Content-Range'); - header("HTTP/1.1 200 OK"); + http_response_code(200); self::sendHeaders($filename, $name, array()); $view->readfile($filename); } |