Removed duplicated error handling for 404 errors

This commit is contained in:
Alejandro Celaya
2016-07-28 09:40:36 +02:00
parent 36259588db
commit af9193f721
8 changed files with 18 additions and 79 deletions

View File

@@ -70,7 +70,7 @@ class RedirectAction implements MiddlewareInterface
// If provided shortCode does not belong to a valid long URL, dispatch next middleware, which will trigger
// a not-found error
if (! isset($longUrl)) {
return $out($request, $response);
return $out($request, $response->withStatus(404), 'Not found');
}
// Track visit to this shortcode