mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-19 05:21:29 +03:00
remove gzip encoding in Legacy AB pushes (#13937)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -1015,16 +1015,8 @@ class LegacyAb extends BaseAb {
|
|||||||
var authHeaders = getHttpHeaders();
|
var authHeaders = getHttpHeaders();
|
||||||
authHeaders['Content-Type'] = "application/json";
|
authHeaders['Content-Type'] = "application/json";
|
||||||
final body = jsonEncode({"data": jsonEncode(_serialize())});
|
final body = jsonEncode({"data": jsonEncode(_serialize())});
|
||||||
http.Response resp;
|
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);
|
await http.post(Uri.parse(api), headers: authHeaders, body: body);
|
||||||
}
|
|
||||||
if (resp.statusCode == 200 &&
|
if (resp.statusCode == 200 &&
|
||||||
(resp.body.isEmpty || resp.body.toLowerCase() == 'null')) {
|
(resp.body.isEmpty || resp.body.toLowerCase() == 'null')) {
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user