mirror of
https://github.com/friendica/friendica
synced 2025-05-01 03:44:23 +02:00
Improved http error handling
This commit is contained in:
parent
b2165cdf22
commit
4236a9a105
55 changed files with 282 additions and 135 deletions
|
@ -29,6 +29,7 @@ use Friendica\Module\Home;
|
|||
use Friendica\Module\HTTPException\MethodNotAllowed;
|
||||
use Friendica\Module\HTTPException\PageNotFound;
|
||||
use Friendica\Network\HTTPException\MethodNotAllowedException;
|
||||
use Friendica\Network\HTTPException\NoContentException;
|
||||
use Friendica\Network\HTTPException\NotFoundException;
|
||||
use Friendica\Util\Profiler;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
@ -291,9 +292,8 @@ class Module
|
|||
// @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
|
||||
// @todo Check allowed methods per requested path
|
||||
if ($server['REQUEST_METHOD'] === Router::OPTIONS) {
|
||||
header('HTTP/1.1 204 No Content');
|
||||
header('Allow: ' . implode(',', Router::ALLOWED_METHODS));
|
||||
exit();
|
||||
throw new NoContentException();
|
||||
}
|
||||
|
||||
$placeholder = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue