| Index: sdk/lib/io/http_body.dart
|
| diff --git a/sdk/lib/io/http_body.dart b/sdk/lib/io/http_body.dart
|
| index 1ec6d175ed730474b4d5ad4d623331befa78ead3..b6e106bd1145281d03b304344496df986288ce0c 100644
|
| --- a/sdk/lib/io/http_body.dart
|
| +++ b/sdk/lib/io/http_body.dart
|
| @@ -41,22 +41,38 @@ class HttpBodyHandler
|
| implements StreamTransformer<HttpRequest, HttpRequestBody> {
|
| var _transformer;
|
|
|
| - HttpBodyHandler() : _transformer = new _HttpBodyHandlerTransformer();
|
| + /**
|
| + * Create a new [HttpBodyHandler] to be used with a [Stream]<[HttpRequest]>,
|
| + * e.g. a [HttpServer].
|
| + *
|
| + * If the page was served using different encoding than UTF-8, set
|
| + * [defaultEncoding] accordingly. This is required for parsing
|
| + * 'application/x-www-form-urlencoded' content correctly.
|
| + */
|
| + HttpBodyHandler({Encoding defaultEncoding: Encoding.UTF_8})
|
| + : _transformer = new _HttpBodyHandlerTransformer(defaultEncoding);
|
|
|
| /**
|
| * Process and parse an incoming [HttpRequest]. The returned [HttpRequestBody]
|
| * contains a [response] field for accessing the [HttpResponse].
|
| + *
|
| + * See [HttpBodyHandler] constructor for more info on [defaultEncoding].
|
| */
|
| - static Future<HttpRequestBody> processRequest(HttpRequest request) {
|
| - return _HttpBodyHandler.processRequest(request);
|
| + static Future<HttpRequestBody> processRequest(
|
| + HttpRequest request,
|
| + {Encoding defaultEncoding: Encoding.UTF_8}) {
|
| + return _HttpBodyHandler.processRequest(request, defaultEncoding);
|
| }
|
|
|
| /**
|
| * Process and parse an incoming [HttpClientResponse].
|
| + *
|
| + * See [HttpBodyHandler] constructor for more info on [defaultEncoding].
|
| */
|
| static Future<HttpClientResponseBody> processResponse(
|
| - HttpClientResponse response) {
|
| - return _HttpBodyHandler.processResponse(response);
|
| + HttpClientResponse response,
|
| + {Encoding defaultEncoding: Encoding.UTF_8}) {
|
| + return _HttpBodyHandler.processResponse(response, defaultEncoding);
|
| }
|
|
|
| Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
|
|
|