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) { |