@@ -104,12 +104,12 @@ class _HttpProfileData {
104104
105105 Map ? formatConnectionInfo (HttpConnectionInfo ? connectionInfo) =>
106106 connectionInfo == null
107- ? null
108- : {
109- 'localPort' : connectionInfo.localPort,
110- 'remoteAddress' : connectionInfo.remoteAddress.address,
111- 'remotePort' : connectionInfo.remotePort,
112- };
107+ ? null
108+ : {
109+ 'localPort' : connectionInfo.localPort,
110+ 'remoteAddress' : connectionInfo.remoteAddress.address,
111+ 'remotePort' : connectionInfo.remotePort,
112+ };
113113
114114 void finishRequest ({required HttpClientRequest request}) {
115115 // TODO(bkonyi): include encoding?
@@ -309,10 +309,9 @@ class _CopyingBytesBuilder implements BytesBuilder {
309309 Uint8List _buffer;
310310
311311 _CopyingBytesBuilder ([int initialCapacity = 0 ])
312- : _buffer =
313- (initialCapacity <= 0 )
314- ? _emptyList
315- : Uint8List (_pow2roundup (initialCapacity));
312+ : _buffer = (initialCapacity <= 0 )
313+ ? _emptyList
314+ : Uint8List (_pow2roundup (initialCapacity));
316315
317316 void add (List <int > bytes) {
318317 int bytesLength = bytes.length;
@@ -555,12 +554,11 @@ class _HttpRequest extends _HttpInboundMessage implements HttpRequest {
555554 }
556555
557556 var proto = headers['x-forwarded-proto' ];
558- var scheme =
559- proto != null
560- ? proto.first
561- : _httpConnection._socket is SecureSocket
562- ? "https"
563- : "http" ;
557+ var scheme = proto != null
558+ ? proto.first
559+ : _httpConnection._socket is SecureSocket
560+ ? "https"
561+ : "http" ;
564562 var hostList = headers['x-forwarded-host' ];
565563 String host;
566564 if (hostList != null ) {
@@ -1172,10 +1170,9 @@ abstract class _HttpOutboundMessage<T> extends _IOSinkImpl {
11721170 }) : _uri = uri,
11731171 headers = _HttpHeaders (
11741172 protocolVersion,
1175- defaultPortForScheme:
1176- uri.isScheme ('https' )
1177- ? HttpClient .defaultHttpsPort
1178- : HttpClient .defaultHttpPort,
1173+ defaultPortForScheme: uri.isScheme ('https' )
1174+ ? HttpClient .defaultHttpsPort
1175+ : HttpClient .defaultHttpPort,
11791176 initialHeaders: initialHeaders,
11801177 ),
11811178 _outgoing = outgoing,
@@ -1540,11 +1537,10 @@ class _HttpClientRequest extends _HttpOutboundMessage<HttpClientResponse>
15401537 }, onError: (e) {});
15411538 }
15421539
1543- Future <HttpClientResponse > get done =>
1544- _response ?? = Future .wait ([
1545- _responseCompleter.future,
1546- super .done,
1547- ], eagerError: true ).then ((list) => list[0 ]);
1540+ Future <HttpClientResponse > get done => _response ?? = Future .wait ([
1541+ _responseCompleter.future,
1542+ super .done,
1543+ ], eagerError: true ).then ((list) => list[0 ]);
15481544
15491545 Future <HttpClientResponse > close () {
15501546 if (! _aborted) {
@@ -2238,11 +2234,10 @@ class _HttpClientConnection {
22382234 );
22392235 _nextResponseCompleter = null ;
22402236 },
2241- test:
2242- (error) =>
2243- error is HttpException ||
2244- error is SocketException ||
2245- error is TlsException ,
2237+ test: (error) =>
2238+ error is HttpException ||
2239+ error is SocketException ||
2240+ error is TlsException ,
22462241 );
22472242 } else {
22482243 _nextResponseCompleter! .complete (incoming);
@@ -2521,11 +2516,10 @@ class _HttpClientConnection {
25212516 profileData? .requestEvent (error);
25222517 throw HttpException (error, uri: request.uri);
25232518 }
2524- var socket =
2525- (response as _HttpClientResponse )
2526- ._httpRequest
2527- ._httpClientConnection
2528- ._socket;
2519+ var socket = (response as _HttpClientResponse )
2520+ ._httpRequest
2521+ ._httpClientConnection
2522+ ._socket;
25292523 return SecureSocket .secure (
25302524 socket,
25312525 host: host,
@@ -2699,16 +2693,15 @@ class _ConnectionTarget {
26992693 connectionTask = cf (uri, host, port);
27002694 }
27012695 } else {
2702- connectionTask =
2703- (isSecure && proxy.isDirect
2704- ? SecureSocket .startConnect (
2705- host,
2706- port,
2707- context: context,
2708- onBadCertificate: callback,
2709- keyLog: client._keyLog,
2710- )
2711- : Socket .startConnect (host, port));
2696+ connectionTask = (isSecure && proxy.isDirect
2697+ ? SecureSocket .startConnect (
2698+ host,
2699+ port,
2700+ context: context,
2701+ onBadCertificate: callback,
2702+ keyLog: client._keyLog,
2703+ )
2704+ : Socket .startConnect (host, port));
27122705 }
27132706 _connecting++ ;
27142707 return connectionTask.then (
@@ -3030,8 +3023,9 @@ class _HttpClient implements HttpClient {
30303023
30313024 int port = uri.port;
30323025 if (port == 0 ) {
3033- port =
3034- isSecure ? HttpClient .defaultHttpsPort : HttpClient .defaultHttpPort;
3026+ port = isSecure
3027+ ? HttpClient .defaultHttpsPort
3028+ : HttpClient .defaultHttpPort;
30353029 }
30363030 // Check to see if a proxy server should be used for this connection.
30373031 var proxyConf = const _ProxyConfiguration .direct ();
@@ -3947,13 +3941,12 @@ abstract class _Credentials {
39473941 // http://tools.ietf.org/html/draft-reschke-basicauth-enc-06. For
39483942 // now always use UTF-8 encoding.
39493943 var creds = credentials as _HttpClientDigestCredentials ;
3950- var hasher =
3951- _MD5 ()
3952- ..add (utf8.encode (creds.username))
3953- ..add ([_CharCode .COLON ])
3954- ..add (realm.codeUnits)
3955- ..add ([_CharCode .COLON ])
3956- ..add (utf8.encode (creds.password));
3944+ var hasher = _MD5 ()
3945+ ..add (utf8.encode (creds.username))
3946+ ..add ([_CharCode .COLON ])
3947+ ..add (realm.codeUnits)
3948+ ..add ([_CharCode .COLON ])
3949+ ..add (utf8.encode (creds.password));
39573950 ha1 = _CryptoUtils .bytesToHex (hasher.close ());
39583951 }
39593952 }
@@ -3972,8 +3965,9 @@ class _SiteCredentials extends _Credentials {
39723965 bool applies (Uri uri, _AuthenticationScheme ? scheme) {
39733966 if (scheme != null && credentials.scheme != scheme) return false ;
39743967 if (uri.host != this .uri.host) return false ;
3975- int thisPort =
3976- this .uri.port == 0 ? HttpClient .defaultHttpPort : this .uri.port;
3968+ int thisPort = this .uri.port == 0
3969+ ? HttpClient .defaultHttpPort
3970+ : this .uri.port;
39773971 int otherPort = uri.port == 0 ? HttpClient .defaultHttpPort : uri.port;
39783972 if (otherPort != thisPort) return false ;
39793973 return uri.path.startsWith (this .uri.path);
@@ -4085,20 +4079,18 @@ final class _HttpClientDigestCredentials extends _HttpClientCredentials
40854079
40864080 String authorization (_Credentials credentials, _HttpClientRequest request) {
40874081 String requestUri = request._requestUri ();
4088- _MD5 hasher =
4089- _MD5 ()
4090- ..add (request.method.codeUnits)
4091- ..add ([_CharCode .COLON ])
4092- ..add (requestUri.codeUnits);
4082+ _MD5 hasher = _MD5 ()
4083+ ..add (request.method.codeUnits)
4084+ ..add ([_CharCode .COLON ])
4085+ ..add (requestUri.codeUnits);
40934086 var ha2 = _CryptoUtils .bytesToHex (hasher.close ());
40944087
40954088 bool isAuth = false ;
40964089 String cnonce = "" ;
40974090 String nc = "" ;
4098- hasher =
4099- _MD5 ()
4100- ..add (credentials.ha1! .codeUnits)
4101- ..add ([_CharCode .COLON ]);
4091+ hasher = _MD5 ()
4092+ ..add (credentials.ha1! .codeUnits)
4093+ ..add ([_CharCode .COLON ]);
41024094 if (credentials.qop == "auth" ) {
41034095 isAuth = true ;
41044096 cnonce = _CryptoUtils .bytesToHex (_CryptoUtils .getRandomBytes (4 ));
@@ -4123,14 +4115,13 @@ final class _HttpClientDigestCredentials extends _HttpClientCredentials
41234115 }
41244116 var response = _CryptoUtils .bytesToHex (hasher.close ());
41254117
4126- StringBuffer buffer =
4127- StringBuffer ()
4128- ..write ('Digest ' )
4129- ..write ('username="$username "' )
4130- ..write (', realm="${credentials .realm }"' )
4131- ..write (', nonce="${credentials .nonce }"' )
4132- ..write (', uri="$requestUri "' )
4133- ..write (', algorithm="${credentials .algorithm }"' );
4118+ StringBuffer buffer = StringBuffer ()
4119+ ..write ('Digest ' )
4120+ ..write ('username="$username "' )
4121+ ..write (', realm="${credentials .realm }"' )
4122+ ..write (', nonce="${credentials .nonce }"' )
4123+ ..write (', uri="$requestUri "' )
4124+ ..write (', algorithm="${credentials .algorithm }"' );
41344125 if (isAuth) {
41354126 buffer
41364127 ..write (', qop="auth"' )
0 commit comments