From 1796a1ec1c9eefbd119d84a54a0eae1092779207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20R=2E?= Date: Sat, 19 Apr 2025 01:43:06 +0200 Subject: [PATCH] FIX: Fixed bad parsing of binary request bodies --- lib/extensions/request.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/extensions/request.dart b/lib/extensions/request.dart index 4bcae8c..bce7521 100644 --- a/lib/extensions/request.dart +++ b/lib/extensions/request.dart @@ -21,7 +21,13 @@ extension RequestCopyWith on Request { final copied = Request( method?.asString ?? this.method, url ?? this.url, - )..body = this.body; + )..bodyBytes = this.bodyBytes; + + try { + copied.body = this.body; + } catch (e) { + // Do not try to get body as string when it is not parseable + } if (body != null) { copied.body = body;