Hacked together better PUT support
This commit is contained in:
parent
78c8ed42ac
commit
e2980b465c
1 changed files with 10 additions and 3 deletions
|
@ -26,11 +26,18 @@ class APIv1 extends CustomModule
|
|||
// Checks the key
|
||||
try
|
||||
{
|
||||
if (isset($_REQUEST['key']))
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'PUT')
|
||||
{
|
||||
if (strlen($_REQUEST['key']) == 40)
|
||||
parse_str(file_get_contents("php://input"), $_PUT);
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['key']) || isset($_PUT['key']))
|
||||
{
|
||||
$api_key = isset($_PUT['key']) ? $_PUT['key'] : $_REQUEST['key'];
|
||||
|
||||
if (strlen($api_key) == 40)
|
||||
{
|
||||
$uid = $this->redis->get('user:api:' . $_REQUEST['key']);
|
||||
$uid = $this->redis->get('user:api:' . $api_key);
|
||||
|
||||
if ($uid)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue