Browse Source

Merge pull request #1161 from nextcloud/perf/dynamite_runtime/deserialization_order

pull/1163/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
b207dedc0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart

6
packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart

@ -73,15 +73,15 @@ class DynamiteRawResponse<B, H> {
// ignore: discarded_futures // ignore: discarded_futures
response.then( response.then(
(final response) async { (final response) async {
_rawHeaders = response.responseHeaders;
final headers = deserializeHeaders<H>(_rawHeaders, serializers, headersType);
_rawBody = switch (bodyType) { _rawBody = switch (bodyType) {
const FullType(Uint8List) => await response.bytes, const FullType(Uint8List) => await response.bytes,
const FullType(String) => await response.string, const FullType(String) => await response.string,
_ => await response.json, _ => await response.json,
}; };
_rawHeaders = response.responseHeaders;
final body = deserializeBody<B>(_rawBody, serializers, bodyType); final body = deserializeBody<B>(_rawBody, serializers, bodyType);
final headers = deserializeHeaders<H>(_rawHeaders, serializers, headersType);
_response = DynamiteResponse<B, H>( _response = DynamiteResponse<B, H>(
response.statusCode, response.statusCode,

Loading…
Cancel
Save