| 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 _HttpHeaders implements HttpHeaders { | 7 class _HttpHeaders implements HttpHeaders { |
| 8 _HttpHeaders(String this.protocolVersion) | 8 _HttpHeaders(String this.protocolVersion) |
| 9 : _headers = new Map<String, List<String>>(); | 9 : _headers = new Map<String, List<String>>(); |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 add(name, value); | 41 add(name, value); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void remove(String name, Object value) { | 44 void remove(String name, Object value) { |
| 45 _checkMutable(); | 45 _checkMutable(); |
| 46 name = name.toLowerCase(); | 46 name = name.toLowerCase(); |
| 47 List<String> values = _headers[name]; | 47 List<String> values = _headers[name]; |
| 48 if (values != null) { | 48 if (values != null) { |
| 49 int index = values.indexOf(value); | 49 int index = values.indexOf(value); |
| 50 if (index != -1) { | 50 if (index != -1) { |
| 51 values.removeRange(index, 1); | 51 values.removeRange(index, index + 1); |
| 52 } | 52 } |
| 53 if (values.length == 0) _headers.remove(name); | 53 if (values.length == 0) _headers.remove(name); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void removeAll(String name) { | 57 void removeAll(String name) { |
| 58 _checkMutable(); | 58 _checkMutable(); |
| 59 name = name.toLowerCase(); | 59 name = name.toLowerCase(); |
| 60 _headers.remove(name); | 60 _headers.remove(name); |
| 61 } | 61 } |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 | 764 |
| 765 String name; | 765 String name; |
| 766 String value; | 766 String value; |
| 767 DateTime expires; | 767 DateTime expires; |
| 768 int maxAge; | 768 int maxAge; |
| 769 String domain; | 769 String domain; |
| 770 String path; | 770 String path; |
| 771 bool httpOnly = false; | 771 bool httpOnly = false; |
| 772 bool secure = false; | 772 bool secure = false; |
| 773 } | 773 } |
| OLD | NEW |