Skip to content

Commit

Permalink
perf(dynamite_runtime): DynamiteRawResponse deserialize headers while…
Browse files Browse the repository at this point in the history
… waiting for the body

Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Nov 19, 2023
1 parent c5f54ea commit 2cec2ed
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ class DynamiteRawResponse<B, H> {
// ignore: discarded_futures
response.then(
(final response) async {
_rawHeaders = response.responseHeaders;
final headers = deserializeHeaders<H>(_rawHeaders, serializers, headersType);

_rawBody = switch (bodyType) {
const FullType(Uint8List) => await response.bytes,
const FullType(String) => await response.string,
_ => await response.json,
};
_rawHeaders = response.responseHeaders;

final body = deserializeBody<B>(_rawBody, serializers, bodyType);
final headers = deserializeHeaders<H>(_rawHeaders, serializers, headersType);

_response = DynamiteResponse<B, H>(
response.statusCode,
Expand Down

0 comments on commit 2cec2ed

Please sign in to comment.