Commit 9db22b8b authored by Röpert, Dominik's avatar Röpert, Dominik
Browse files

added redirect status code 303

parent f64cb93e
......@@ -27,7 +27,7 @@ $app->get('/object[/[{barcode}]]', function ($request, $response, $args) {
'config' => Config::get('sitemap')
])->withHeader('Content-type', 'application/xml');
}
return $response->withRedirect(Config::get('urls')['catalog_url']);
return $response->withRedirect(Config::get('urls')['catalog_url'], 303);
}
## If barcode was not found in DB, return 404
......@@ -37,12 +37,12 @@ $app->get('/object[/[{barcode}]]', function ($request, $response, $args) {
## html
if($bestContentType === Config::get('contenttypes')['html'])
return $response->withRedirect($this->get('router')->pathFor('page', [
'barcode' => $barcode]));
'barcode' => $barcode]), 303);
## rdf
if($bestContentType === Config::get('contenttypes')['rdf'])
return $response->withRedirect($this->get('router')->pathFor('rdf', [
'barcode' => $barcode]));
'barcode' => $barcode]), 303);
## nothing
return $this->view->render($response, '406.template.twig')->withStatus(406);
......@@ -59,7 +59,7 @@ $app->group('/data', function() use ($app) {
## If no barcode is given, redirect to catalog
if(!isset($barcode))
return $response->withRedirect(Config::get('urls')['catalog_url']);
return $response->withRedirect(Config::get('urls')['catalog_url'], 303);
## If barcode was not found in DB, return 404
if(!$barcodeUtil->isInDB($barcode))
......@@ -68,8 +68,8 @@ $app->group('/data', function() use ($app) {
## Get URL for redirect
$htmlUri = $barcodeUtil->fetchHtmlUri($barcode);
if(!isset($htmlUri) || empty($htmlUri))
return $response->withRedirect(sprintf(Config::get('urls')['html_url'], $barcode));
return $response->withRedirect($htmlUri);
return $response->withRedirect(sprintf(Config::get('urls')['html_url'], $barcode), 303);
return $response->withRedirect($htmlUri, 303);
})->setName('page');
$app->get('/rdf[/[{barcode}]]', function ($request, $response, $args) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment