From 1279159fd4d5c8d90f634f20180eb4df88cf129e Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Fri, 10 Jul 2026 22:12:02 +0200 Subject: [PATCH] fix(graphs): accept gzip session uploads from mobile client Use read_crash_upload_body() so graph_upload matches CrashUploadClient Content-Encoding: gzip. Co-authored-by: Cursor --- public/api/graph_upload.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);