Skip to content

Commit

Permalink
✅ ++
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Dec 3, 2023
1 parent 9f26ae2 commit c0a3150
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dio/lib/src/adapters/io_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ class IOHttpClientAdapter implements HttpClientAdapter {
});
}

responseSubscription = responseStream.listen(
responseSubscription = responseStream.cast<Uint8List>().listen(
(data) {
watchReceiveTimeout();
// Always true if the receive timeout was not set.
if (receiveStopwatch.elapsed <= receiveTimeout) {
responseSink.add(data is Uint8List ? data : Uint8List.fromList(data));
responseSink.add(data);
}
},
onError: (error, stackTrace) {
Expand Down
3 changes: 1 addition & 2 deletions dio/test/options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,7 @@ void main() {
when(response.reasonPhrase).thenReturn('OK');
when(response.isRedirect).thenReturn(false);
when(response.redirects).thenReturn([]);
when(response.transform(any))
.thenAnswer((_) => Stream<Uint8List>.empty());
when(response.cast()).thenAnswer((_) => Stream<Uint8List>.empty());
return Future.value(request);
});

Expand Down

0 comments on commit c0a3150

Please sign in to comment.