mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added zend problem details to the project
This commit is contained in:
@@ -18,7 +18,6 @@ use Zend\Expressive\Template\TemplateRendererInterface;
|
||||
|
||||
use function array_shift;
|
||||
use function explode;
|
||||
use function Functional\contains;
|
||||
use function rtrim;
|
||||
|
||||
class NotFoundHandler implements RequestHandlerInterface
|
||||
@@ -64,14 +63,6 @@ class NotFoundHandler implements RequestHandlerInterface
|
||||
$accept = array_shift($accepts);
|
||||
$status = StatusCodeInterface::STATUS_NOT_FOUND;
|
||||
|
||||
// If the first accepted type is json, return a json response
|
||||
if (contains(['application/json', 'text/json', 'application/x-json'], $accept)) {
|
||||
return new Response\JsonResponse([
|
||||
'error' => 'NOT_FOUND',
|
||||
'message' => 'Not found',
|
||||
], $status);
|
||||
}
|
||||
|
||||
$template = $routeResult->isFailure() ? self::NOT_FOUND_TEMPLATE : self::INVALID_SHORT_CODE_TEMPLATE;
|
||||
return new Response\HtmlResponse($this->renderer->render($template), $status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user