From 1c794e94902ce4903705b34d9a39afe2e2f18e17 Mon Sep 17 00:00:00 2001 From: Ayush Suman Date: Mon, 23 Oct 2023 11:53:21 +0530 Subject: [PATCH] Update --- lib/src/http_worker/io_http_worker.dart | 2 +- lib/src/http_worker/web_http_worker.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/http_worker/io_http_worker.dart b/lib/src/http_worker/io_http_worker.dart index 4b4d79b..12c682a 100644 --- a/lib/src/http_worker/io_http_worker.dart +++ b/lib/src/http_worker/io_http_worker.dart @@ -90,7 +90,7 @@ class DefaultHttpWorker extends HttpWorker { final Encoding encoding = encodingForCharset(response.headers.contentType?.charset); final String responseBody = encoding.decode(bytes); final parsedBody = parser?.parse(responseBody); - completer.complete(Response(status: response.statusCode, data: parsedBody ?? body as T)); + completer.complete(Response(status: response.statusCode, data: parsedBody ?? responseBody as T)); requestStoreManager.removeFromStore(id); } catch (e) { completer.complete(Response(status: -1, error: e)); diff --git a/lib/src/http_worker/web_http_worker.dart b/lib/src/http_worker/web_http_worker.dart index bf8ab6c..3909e28 100644 --- a/lib/src/http_worker/web_http_worker.dart +++ b/lib/src/http_worker/web_http_worker.dart @@ -93,7 +93,7 @@ class DefaultHttpWorker extends HttpWorker { final Encoding encoding = encodingForCharset(MediaType.parse(request.responseHeaders['content-type']??'application/octet-stream').parameters['charset']); final String responseBody = encoding.decode(responseBytes); final T? parsedBody = parser?.parse(responseBody); - completer.complete(Response(status: request.status!, data: parsedBody ?? body as T)); + completer.complete(Response(status: request.status!, data: parsedBody ?? responseBody as T)); requestStoreManager.removeFromStore(id); });