| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class _HttpHeaders implements HttpHeaders { | 5 class _HttpHeaders implements HttpHeaders { |
| 6 _HttpHeaders() : _headers = new Map<String, List<String>>(); | 6 _HttpHeaders() : _headers = new Map<String, List<String>>(); |
| 7 | 7 |
| 8 List<String> operator[](String name) { | 8 List<String> operator[](String name) { |
| 9 name = name.toLowerCase(); | 9 name = name.toLowerCase(); |
| 10 return _headers[name]; | 10 return _headers[name]; |
| (...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 void _writeHeader() { | 1668 void _writeHeader() { |
| 1669 List<int> data; | 1669 List<int> data; |
| 1670 | 1670 |
| 1671 // Write request line. | 1671 // Write request line. |
| 1672 data = _method.toString().charCodes(); | 1672 data = _method.toString().charCodes(); |
| 1673 _httpConnection._write(data); | 1673 _httpConnection._write(data); |
| 1674 _writeSP(); | 1674 _writeSP(); |
| 1675 // Send the path for direct connections and the whole URL for | 1675 // Send the path for direct connections and the whole URL for |
| 1676 // proxy connections. | 1676 // proxy connections. |
| 1677 if (!_connection._usingProxy) { | 1677 if (!_connection._usingProxy) { |
| 1678 String path; | 1678 String path = _uri.path; |
| 1679 if (path.length == 0) path = "/"; |
| 1679 if (_uri.query != "") { | 1680 if (_uri.query != "") { |
| 1680 if (_uri.fragment != "") { | 1681 if (_uri.fragment != "") { |
| 1681 path = "${_uri.path}?${_uri.query}#${_uri.fragment}"; | 1682 path = "${path}?${_uri.query}#${_uri.fragment}"; |
| 1682 } else { | 1683 } else { |
| 1683 path = "${_uri.path}?${_uri.query}"; | 1684 path = "${path}?${_uri.query}"; |
| 1684 } | 1685 } |
| 1685 } else { | |
| 1686 path = _uri.path; | |
| 1687 } | 1686 } |
| 1688 data = path.charCodes(); | 1687 data = path.charCodes(); |
| 1689 } else { | 1688 } else { |
| 1690 data = _uri.toString().charCodes(); | 1689 data = _uri.toString().charCodes(); |
| 1691 } | 1690 } |
| 1692 _httpConnection._write(data); | 1691 _httpConnection._write(data); |
| 1693 _writeSP(); | 1692 _writeSP(); |
| 1694 _httpConnection._write(_Const.HTTP11); | 1693 _httpConnection._write(_Const.HTTP11); |
| 1695 _writeCRLF(); | 1694 _writeCRLF(); |
| 1696 | 1695 |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 | 2346 |
| 2348 | 2347 |
| 2349 class _RedirectInfo implements RedirectInfo { | 2348 class _RedirectInfo implements RedirectInfo { |
| 2350 const _RedirectInfo(int this.statusCode, | 2349 const _RedirectInfo(int this.statusCode, |
| 2351 String this.method, | 2350 String this.method, |
| 2352 Uri this.location); | 2351 Uri this.location); |
| 2353 final int statusCode; | 2352 final int statusCode; |
| 2354 final String method; | 2353 final String method; |
| 2355 final Uri location; | 2354 final Uri location; |
| 2356 } | 2355 } |
| OLD | NEW |