diff --git a/public/api/graph_upload.php b/public/api/graph_upload.php index e686395..41b51e2 100644 --- a/public/api/graph_upload.php +++ b/public/api/graph_upload.php @@ -2,10 +2,13 @@ declare(strict_types=1); require_once __DIR__ . '/../../src/bootstrap.php'; -$raw = file_get_contents('php://input'); -if ($raw === false || $raw === '') { +$raw = read_crash_upload_body(); +if ($raw === null) { json_out(['ok' => false, 'error' => 'empty body'], 400); } +if ($raw === false) { + json_out(['ok' => false, 'error' => 'invalid gzip body'], 400); +} $data = json_decode($raw, true); if (!is_array($data)) { json_out(['ok' => false, 'error' => 'invalid json'], 400);