Chromium Code Reviews| Index: pkg/http/lib/src/request.dart |
| diff --git a/pkg/http/lib/src/request.dart b/pkg/http/lib/src/request.dart |
| index 670bc4837228ec756b1caf6ae70ac963d80003b3..4af2fd1d155a70b59809af8f7834d294b6a7cd90 100644 |
| --- a/pkg/http/lib/src/request.dart |
| +++ b/pkg/http/lib/src/request.dart |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -57,7 +57,9 @@ class Request extends BaseRequest { |
| _defaultEncoding = value; |
| var contentType = _contentType; |
| if (contentType != null) { |
| - contentType.charset = value.name; |
| + contentType = new ContentType(contentType.primaryType, |
| + contentType.subType, |
| + value.name); |
|
nweiz
2013/03/05 20:43:18
Same here.
Søren Gjesse
2013/03/06 13:23:30
Done.
|
| _contentType = contentType; |
| } |
| } |
| @@ -87,8 +89,13 @@ class Request extends BaseRequest { |
| set body(String value) { |
| bodyBytes = encodeString(value, encoding); |
| var contentType = _contentType; |
| - if (contentType == null) contentType = new ContentType("text", "plain"); |
| - if (contentType.charset == null) contentType.charset = encoding.name; |
| + if (contentType == null) { |
| + contentType = new ContentType("text", "plain", encoding.name); |
| + } else if (contentType.charset == null) { |
| + contentType = new ContentType(contentType.primaryType, |
| + contentType.subType, |
| + encoding.name); |
|
nweiz
2013/03/05 20:43:18
And here.
Søren Gjesse
2013/03/06 13:23:30
Done.
|
| + } |
| _contentType = contentType; |
| } |