OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 class _HttpIncoming | 7 class _HttpIncoming |
8 extends Stream<List<int>> implements StreamSink<List<int>> { | 8 extends Stream<List<int>> implements StreamSink<List<int>> { |
9 final int _transferLength; | 9 final int _transferLength; |
10 final Completer _dataCompleter = new Completer(); | 10 final Completer _dataCompleter = new Completer(); |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 } | 1590 } |
1591 | 1591 |
1592 void authorize(HttpClientRequest request) { | 1592 void authorize(HttpClientRequest request) { |
1593 credentials.authorize(this, request); | 1593 credentials.authorize(this, request); |
1594 used = true; | 1594 used = true; |
1595 } | 1595 } |
1596 | 1596 |
1597 bool used = false; | 1597 bool used = false; |
1598 Uri uri; | 1598 Uri uri; |
1599 String realm; | 1599 String realm; |
1600 HttpClientCredentials credentials; | 1600 _HttpClientCredentials credentials; |
1601 | 1601 |
1602 // Digest specific fields. | 1602 // Digest specific fields. |
1603 String nonce; | 1603 String nonce; |
1604 String algorithm; | 1604 String algorithm; |
1605 String qop; | 1605 String qop; |
1606 } | 1606 } |
1607 | 1607 |
1608 | 1608 |
1609 abstract class _HttpClientCredentials implements HttpClientCredentials { | 1609 abstract class _HttpClientCredentials implements HttpClientCredentials { |
1610 _AuthenticationScheme get scheme; | 1610 _AuthenticationScheme get scheme; |
1611 void authorize(HttpClientRequest request); | 1611 void authorize(_Credentials credentials, HttpClientRequest request); |
1612 } | 1612 } |
1613 | 1613 |
1614 | 1614 |
1615 class _HttpClientBasicCredentials implements HttpClientBasicCredentials { | 1615 class _HttpClientBasicCredentials implements HttpClientBasicCredentials { |
1616 _HttpClientBasicCredentials(this.username, | 1616 _HttpClientBasicCredentials(this.username, |
1617 this.password); | 1617 this.password); |
1618 | 1618 |
1619 _AuthenticationScheme get scheme => _AuthenticationScheme.BASIC; | 1619 _AuthenticationScheme get scheme => _AuthenticationScheme.BASIC; |
1620 | 1620 |
1621 void authorize(_Credentials _, HttpClientRequest request) { | 1621 void authorize(_Credentials _, HttpClientRequest request) { |
(...skipping 30 matching lines...) Expand all Loading... |
1652 | 1652 |
1653 | 1653 |
1654 class _RedirectInfo implements RedirectInfo { | 1654 class _RedirectInfo implements RedirectInfo { |
1655 const _RedirectInfo(int this.statusCode, | 1655 const _RedirectInfo(int this.statusCode, |
1656 String this.method, | 1656 String this.method, |
1657 Uri this.location); | 1657 Uri this.location); |
1658 final int statusCode; | 1658 final int statusCode; |
1659 final String method; | 1659 final String method; |
1660 final Uri location; | 1660 final Uri location; |
1661 } | 1661 } |
OLD | NEW |