set allowMalformed to true when decode utf8 (#12693)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-08-20 14:55:52 +08:00
committed by GitHub
parent e0ab3f0c92
commit 5ff1740b5b
5 changed files with 27 additions and 15 deletions

View File

@@ -66,7 +66,7 @@ class UserModel {
reset(resetOther: status == 401);
return;
}
final data = json.decode(utf8.decode(response.bodyBytes));
final data = json.decode(decode_http_response(response));
final error = data['error'];
if (error != null) {
throw error;
@@ -160,7 +160,7 @@ class UserModel {
final Map<String, dynamic> body;
try {
body = jsonDecode(utf8.decode(resp.bodyBytes));
body = jsonDecode(decode_http_response(resp));
} catch (e) {
debugPrint("login: jsonDecode resp body failed: ${e.toString()}");
if (resp.statusCode != 200) {