summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-27 12:14:52 +0200
committerGitHub <noreply@github.com>2018-06-27 12:14:52 +0200
commite4e3387417deefbd873d469dfa9fa97444ca1a11 (patch)
tree13c9c3132aa036e4f8cee4d42a07c92dc50e3e8f /apps/files_sharing
parentd984be7e2a23d41d03865309e37e66cb00e7ca65 (diff)
parentb0a296e2e1dd1b173d9cab8c82158ac6bfb86f9e (diff)
downloadnextcloud-server-e4e3387417deefbd873d469dfa9fa97444ca1a11.tar.gz
nextcloud-server-e4e3387417deefbd873d469dfa9fa97444ca1a11.zip
Merge pull request #10009 from nextcloud/techdebt/noid/replace-headers-with-http_response_code-calls
Replace hard coded HTTP status codes with proper calls to http_response_code
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/public.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 0ca7e8f245e..e1e4aa877b2 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -30,14 +30,13 @@ $route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare
if($token !== '') {
$protocol = \OC::$server->getRequest()->getHttpProtocol();
if ($protocol == 'HTTP/1.0') {
- $status = '302 Found';
+ http_response_code(302);
} else {
- $status = '307 Temporary Redirect';
+ http_response_code(307);
}
- header($protocol.' ' . $status);
header('Location: ' . $urlGenerator->linkToRoute($route, array('token' => $token)));
} else {
- header('HTTP/1.0 404 Not Found');
+ http_response_code(404);
$tmpl = new OCP\Template('', '404', 'guest');
print_unescaped($tmpl->fetchPage());
}