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 extends Stream<List<int>> { | 7 class _HttpIncoming extends Stream<List<int>> { |
8 final int _transferLength; | 8 final int _transferLength; |
9 final Completer _dataCompleter = new Completer(); | 9 final Completer _dataCompleter = new Completer(); |
10 Stream<List<int>> _stream; | 10 Stream<List<int>> _stream; |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 addString(uri.toString()); | 670 addString(uri.toString()); |
671 } | 671 } |
672 writeSP(); | 672 writeSP(); |
673 add(_Const.HTTP11); | 673 add(_Const.HTTP11); |
674 writeCRLF(); | 674 writeCRLF(); |
675 | 675 |
676 // Add the cookies to the headers. | 676 // Add the cookies to the headers. |
677 if (!cookies.isEmpty) { | 677 if (!cookies.isEmpty) { |
678 StringBuffer sb = new StringBuffer(); | 678 StringBuffer sb = new StringBuffer(); |
679 for (int i = 0; i < cookies.length; i++) { | 679 for (int i = 0; i < cookies.length; i++) { |
680 if (i > 0) sb.add("; "); | 680 if (i > 0) sb.write("; "); |
681 sb.add(cookies[i].name); | 681 sb.write(cookies[i].name); |
682 sb.add("="); | 682 sb.write("="); |
683 sb.add(cookies[i].value); | 683 sb.write(cookies[i].value); |
684 } | 684 } |
685 headers.add(HttpHeaders.COOKIE, sb.toString()); | 685 headers.add(HttpHeaders.COOKIE, sb.toString()); |
686 } | 686 } |
687 | 687 |
688 headers._finalize(); | 688 headers._finalize(); |
689 | 689 |
690 // Write headers. | 690 // Write headers. |
691 headers._write(this); | 691 headers._write(this); |
692 writeCRLF(); | 692 writeCRLF(); |
693 } | 693 } |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 | 1639 |
1640 | 1640 |
1641 class _RedirectInfo implements RedirectInfo { | 1641 class _RedirectInfo implements RedirectInfo { |
1642 const _RedirectInfo(int this.statusCode, | 1642 const _RedirectInfo(int this.statusCode, |
1643 String this.method, | 1643 String this.method, |
1644 Uri this.location); | 1644 Uri this.location); |
1645 final int statusCode; | 1645 final int statusCode; |
1646 final String method; | 1646 final String method; |
1647 final Uri location; | 1647 final Uri location; |
1648 } | 1648 } |
OLD | NEW |