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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 } | 564 } |
565 return s.substring(start, index).toLowerCase(); | 565 return s.substring(start, index).toLowerCase(); |
566 } | 566 } |
567 | 567 |
568 String parseParameterValue() { | 568 String parseParameterValue() { |
569 if (s[index] == "\"") { | 569 if (s[index] == "\"") { |
570 // Parse quoted value. | 570 // Parse quoted value. |
571 StringBuffer sb = new StringBuffer(); | 571 StringBuffer sb = new StringBuffer(); |
572 index++; | 572 index++; |
573 while (!done()) { | 573 while (!done()) { |
574 print(s[index]); | |
575 if (s[index] == "\\") { | 574 if (s[index] == "\\") { |
576 if (index + 1 == s.length) { | 575 if (index + 1 == s.length) { |
577 throw new HttpException("Failed to parse header value"); | 576 throw new HttpException("Failed to parse header value"); |
578 } | 577 } |
579 if (preserveBackslash && s[index + 1] != "\"") { | 578 if (preserveBackslash && s[index + 1] != "\"") { |
580 sb.write(s[index]); | 579 sb.write(s[index]); |
581 } | 580 } |
582 index++; | 581 index++; |
583 } else if (s[index] == "\"") { | 582 } else if (s[index] == "\"") { |
584 index++; | 583 index++; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 void clear() { | 822 void clear() { |
824 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 823 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
825 } | 824 } |
826 void forEach(void f(K key, V value)) => _map.forEach(f); | 825 void forEach(void f(K key, V value)) => _map.forEach(f); |
827 Iterable<K> get keys => _map.keys; | 826 Iterable<K> get keys => _map.keys; |
828 Iterable<V> get values => _map.values; | 827 Iterable<V> get values => _map.values; |
829 int get length => _map.length; | 828 int get length => _map.length; |
830 bool get isEmpty => _map.isEmpty; | 829 bool get isEmpty => _map.isEmpty; |
831 bool get isNotEmpty => _map.isNotEmpty; | 830 bool get isNotEmpty => _map.isNotEmpty; |
832 } | 831 } |
OLD | NEW |