]> git.mxchange.org Git - friendica.git/commitdiff
Treat unsupported API call as HTTP error
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 8 Jan 2023 03:47:52 +0000 (22:47 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 8 Jan 2023 03:47:52 +0000 (22:47 -0500)
src/Module/Api/ApiResponse.php

index 2d54bc176533fead897ea18ffb68c6ee801e9f8f..b5b2a4717c45bf9a25c9a34c15a1463aff8d5769 100644 (file)
@@ -276,9 +276,8 @@ class ApiResponse extends Response
                                'agent'   => $_SERVER['HTTP_USER_AGENT'] ?? '',
                                'request' => $request,
                        ]);
-               $error             = $this->l10n->t('API endpoint %s %s is not implemented', strtoupper($method), $path);
-               $error_description = $this->l10n->t('The API endpoint is currently not implemented but might be in the future.');
+               $error = $this->l10n->t('API endpoint %s %s is not implemented but might be in the future.', strtoupper($method), $path);
 
-               $this->exit('error', ['error' => ['error' => $error, 'error_description' => $error_description]]);
+               $this->error(501, 'Not Implemented', $error);
        }
 }