Skip to content

Commit

Permalink
refactor: eta-reduction of call to request.setRequestHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
aran committed Dec 16, 2024
1 parent 00a012a commit 93909b7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/src/client/transport/xhr_transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ class XhrClientConnection implements ClientConnection {

void _initializeRequest(
XMLHttpRequest request, Map<String, String> metadata) {
metadata.forEach((key, value) {
request.setRequestHeader(key, value);
});
metadata.forEach(request.setRequestHeader);
// Overriding the mimetype allows us to stream and parse the data
request.overrideMimeType('text/plain; charset=x-user-defined');
request.responseType = 'text';
Expand Down

0 comments on commit 93909b7

Please sign in to comment.