Chromium Code Reviews

Unified Diff: pkg/http/lib/src/request.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed accidental edit Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | pkg/http/lib/src/utils.dart » ('j') | pkg/http/lib/src/utils.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/request.dart
diff --git a/pkg/http/lib/src/request.dart b/pkg/http/lib/src/request.dart
index 525f1aed6e58fa8923592c4807f51f9dfbd01b5a..51bde43a28bfb6c7f12e947ed4b02d31d19ef5f9 100644
--- a/pkg/http/lib/src/request.dart
+++ b/pkg/http/lib/src/request.dart
@@ -49,7 +49,12 @@ class Request extends BaseRequest {
if (_contentType == null || _contentType.charset == null) {
return _defaultEncoding;
}
- return requiredEncodingForCharset(_contentType.charset);
+ var encoding = Encoding.fromName(_contentType.charset);
+ if (encoding == null) {
+ throw new FormatException(
+ 'Unsupported encoding "${_contentType.charset}".');
+ }
+ return encoding;
}
set encoding(Encoding value) {
« no previous file with comments | « no previous file | pkg/http/lib/src/utils.dart » ('j') | pkg/http/lib/src/utils.dart » ('J')

Powered by Google App Engine