Skip to content

Commit

Permalink
✨ Add redirects in IOStreamedResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Dec 10, 2023
1 parent db7f165 commit dc5901b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/http/lib/src/io_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class IOClient extends BaseClient {
request: request,
headers: headers,
isRedirect: response.isRedirect,
redirects: response.redirects,
persistentConnection: response.persistentConnection,
reasonPhrase: response.reasonPhrase,
inner: response);
Expand Down
7 changes: 7 additions & 0 deletions pkgs/http/lib/src/io_streamed_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ class IOStreamedResponse extends StreamedResponse {
super.isRedirect,
super.persistentConnection,
super.reasonPhrase,
this.redirects = const [],
HttpClientResponse? inner})
: _inner = inner;

/// Returns the series of redirects this connection has been through.
/// The list will be empty if no redirects were followed.
/// [redirects] will be updated both in the case of
/// an automatic and a manual redirect.
final List<RedirectInfo> redirects;

/// Detaches the underlying socket from the HTTP server.
///
/// Will throw if `inner` was not set or `null` when `this` was created.
Expand Down

0 comments on commit dc5901b

Please sign in to comment.