| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library http_parser.media_type; | |
| 6 | |
| 7 import 'package:collection/collection.dart'; | 5 import 'package:collection/collection.dart'; |
| 8 import 'package:string_scanner/string_scanner.dart'; | 6 import 'package:string_scanner/string_scanner.dart'; |
| 9 | 7 |
| 10 import 'case_insensitive_map.dart'; | 8 import 'case_insensitive_map.dart'; |
| 11 import 'scan.dart'; | 9 import 'scan.dart'; |
| 12 import 'utils.dart'; | 10 import 'utils.dart'; |
| 13 | 11 |
| 14 /// A regular expression matching a character that needs to be backslash-escaped | 12 /// A regular expression matching a character that needs to be backslash-escaped |
| 15 /// in a quoted string. | 13 /// in a quoted string. |
| 16 final _escapedChar = new RegExp(r'["\x00-\x1F\x7F]'); | 14 final _escapedChar = new RegExp(r'["\x00-\x1F\x7F]'); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 value.replaceAllMapped(_escapedChar, (match) => "\\" + match[0])) | 141 value.replaceAllMapped(_escapedChar, (match) => "\\" + match[0])) |
| 144 ..write('"'); | 142 ..write('"'); |
| 145 } else { | 143 } else { |
| 146 buffer.write(value); | 144 buffer.write(value); |
| 147 } | 145 } |
| 148 }); | 146 }); |
| 149 | 147 |
| 150 return buffer.toString(); | 148 return buffer.toString(); |
| 151 } | 149 } |
| 152 } | 150 } |
| OLD | NEW |