No need JSON in POST

This commit is contained in:
Jean TOULZA 2018-07-19 17:43:50 +02:00
parent 296f429bac
commit 863d949b0f
1 changed files with 4 additions and 3 deletions

View File

@ -46,10 +46,11 @@
// set redis val for key
set_redis($key, $val);
} else {
$data = json_decode(file_get_contents('php://input'), true);
if ($data === NULL) {
// got key but no val
$data = file_get_contents('php://input');
if (!$data) {
edie("no val given");
} elseif (count($data) > 500) {
edie("data too long");
} else {
set_redis($key, $data);
}