Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: sdk/lib/io/http_parser.dart

Issue 364313002: Validate headers when added to HttpHeaders. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 258bfc63e89af294485d570800497ecc3ab4a242..d941aa40b63deef9958a9596286b596d2d55188b 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -912,10 +912,15 @@ class _HttpParser extends Stream<_HttpIncoming> {
_index = null;
}
- bool _isTokenChar(int byte) {
+ static bool _isTokenChar(int byte) {
return byte > 31 && byte < 128 && !_Const.SEPARATOR_MAP[byte];
}
+ static bool _isValueChar(int byte) {
+ return (byte > 31 && byte < 128) || (byte == _CharCode.SP) ||
+ (byte == _CharCode.HT);
+ }
+
static List<String> _tokenizeFieldValue(String headerValue) {
List<String> tokens = new List<String>();
int start = 0;
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698