remove gzip encoding in Legacy AB pushes (#13937)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2026-01-02 10:24:47 +08:00
committed by GitHub
parent 7e3f0a607b
commit 9301edef06

View File

@@ -1015,16 +1015,8 @@ class LegacyAb extends BaseAb {
var authHeaders = getHttpHeaders();
authHeaders['Content-Type'] = "application/json";
final body = jsonEncode({"data": jsonEncode(_serialize())});
http.Response resp;
// support compression
if (licensedDevices > 0 && body.length > 1024) {
authHeaders['Content-Encoding'] = "gzip";
resp = await http.post(Uri.parse(api),
headers: authHeaders, body: GZipCodec().encode(utf8.encode(body)));
} else {
resp =
await http.post(Uri.parse(api), headers: authHeaders, body: body);
}
http.Response resp =
await http.post(Uri.parse(api), headers: authHeaders, body: body);
if (resp.statusCode == 200 &&
(resp.body.isEmpty || resp.body.toLowerCase() == 'null')) {
ret = true;