Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/storage_client/lib/src/fetch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ class Fetch {

_log.finest('Request: $method $url $headers');
final http.StreamedResponse streamedResponse;
if (httpClient != null) {
streamedResponse = await httpClient!.send(request);
} else {
streamedResponse = await request.send();
}
// if (httpClient != null) {
// streamedResponse = await httpClient!.send(request);
// } else {
// streamedResponse = await request.send();
// }
streamedResponse = httpClient != null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change, is there a special reason? what is wrong with old implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is self contained in one expression

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but what are the benefit or a bug does this fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just refactoring

? await httpClient!.send(request)
: await request.send();

return _handleResponse(streamedResponse, options);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/storage_client/lib/src/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Bucket {
});

Bucket.fromJson(Map<String, dynamic> json)
: id = (json)['id'] as String,
: id = json['id'] as String,
name = json['name'] as String,
owner = json['owner'] as String,
createdAt = json['created_at'] as String,
Expand Down
Loading