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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 762 |
763 String name; | 763 String name; |
764 String value; | 764 String value; |
765 DateTime expires; | 765 DateTime expires; |
766 int maxAge; | 766 int maxAge; |
767 String domain; | 767 String domain; |
768 String path; | 768 String path; |
769 bool httpOnly = false; | 769 bool httpOnly = false; |
770 bool secure = false; | 770 bool secure = false; |
771 } | 771 } |
OLD | NEW |