From 93909b76685e160512cc0ece92f7776844ea7aaa Mon Sep 17 00:00:00 2001 From: Aran Donohue Date: Mon, 16 Dec 2024 09:15:03 -0800 Subject: [PATCH] refactor: eta-reduction of call to request.setRequestHeader --- lib/src/client/transport/xhr_transport.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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';