mirror of
https://github.com/friendica/friendica
synced 2025-04-26 11:10:11 +00:00
Move System::httpError to BaseModule->httpError
- This will ensure headers set in BaseModule->run will be carried in httpError scenarios - Deprecate httpError() method in Core\System
This commit is contained in:
parent
da1416c07f
commit
e424b7bacb
5 changed files with 35 additions and 11 deletions
|
@ -341,6 +341,7 @@ class System
|
|||
* @param string $message Error message. Optional.
|
||||
* @param string $content Response body. Optional.
|
||||
* @throws \Exception
|
||||
* @deprecated since 2023.09 Use BaseModule->httpError instead
|
||||
*/
|
||||
public static function httpError($httpCode, $message = '', $content = '')
|
||||
{
|
||||
|
@ -348,10 +349,8 @@ class System
|
|||
Logger::debug('Exit with error', ['code' => $httpCode, 'message' => $message, 'callstack' => System::callstack(20), 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
|
||||
}
|
||||
DI::apiResponse()->setStatus($httpCode, $message);
|
||||
DI::apiResponse()->addContent($content);
|
||||
self::echoResponse(DI::apiResponse()->generate());
|
||||
|
||||
self::exit();
|
||||
self::httpExit($content);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue