mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Support more HTTP methods #2287
This commit is contained in:
parent
f419353013
commit
eb5dd18659
3 changed files with 22 additions and 6 deletions
|
|
@ -142,6 +142,15 @@ class Context
|
|||
'@</?script@i' => 'ALLOW ADMIN ONLY',
|
||||
);
|
||||
|
||||
/**
|
||||
* HTTP methods supported by router.
|
||||
*/
|
||||
private static $_router_methods = array(
|
||||
'GET', 'POST', 'JSON', 'XMLRPC',
|
||||
'HEAD', 'OPTIONS', 'PUT', 'PATCH',
|
||||
'DELETE', 'TRACE',
|
||||
);
|
||||
|
||||
/**
|
||||
* Obtain a singleton instance of Context.
|
||||
*
|
||||
|
|
@ -195,7 +204,7 @@ class Context
|
|||
// Set information about the current request.
|
||||
self::_checkGlobalVars();
|
||||
self::setRequestMethod();
|
||||
if (in_array(self::$_instance->request_method, array('GET', 'POST', 'JSON')))
|
||||
if (in_array(self::$_instance->request_method, self::$_router_methods))
|
||||
{
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
|
||||
$request = Rhymix\Framework\Router::parseURL($method, RX_REQUEST_URL, Rhymix\Framework\Router::getRewriteLevel());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue