diff --git a/lib/src/client/transport/xhr_transport.dart b/lib/src/client/transport/xhr_transport.dart index 390e4943..5e0c2291 100644 --- a/lib/src/client/transport/xhr_transport.dart +++ b/lib/src/client/transport/xhr_transport.dart @@ -161,9 +161,7 @@ class XhrClientConnection implements ClientConnection { void _initializeRequest( XMLHttpRequest request, Map 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';