-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/http headers should be case-insensitive #13
Comments
This comment was originally written by [email protected] With the following code snippet, the header 'content-type' is correctly passed. import 'package:http/http.dart' as Http; Request class shouldn't be case sensitive for HTML headers. |
<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 Changed the title to: "pkg/http headers should be case-insensitive". |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 Issue #15 has been merged into this issue. |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 dart-lang/sdk@e47cf13 makes the request headers case-insensitive. We'll need to make the response headers case-insensitive before we can release this, though. |
<img src="https://avatars.githubusercontent.com/u/1924313?v=3" align="left" width="48" height="48"hspace="10"> Comment by jtmcdole This breaks multi-part mime boundaries, which are allowed to be in any case they want to be. See: http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html Content-Type: multipart/mixed; which means the boundary markers are: --gc0p4Jq0M2Yt08jU534c0p |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 Only the header names are case-insensitive, not the values. |
This is resolved on |
Originally opened as dart-lang/sdk#17062
This issue was originally filed by [email protected]
When using the code snippet below, the content-type header is overloaded by "text/plain".
import 'package:http/http.dart' as Http;
Http.post(url, body: postData, headers: { "Content-Type": "text/xml" })
As we can't set _contentType from Request class, could you add 'content-type' in basic client requests also ? (see 'request.dart' source code)
set body(String value) {
bodyBytes = encoding.encode(value);
var contentType = _contentType;
if (contentType == null) {
contentType = new ContentType("text", "plain", charset: encoding.name);
} else if (contentType.charset == null) {
contentType = new ContentType(contentType.primaryType,
contentType.subType,
charset: encoding.name,
parameters: contentType.parameters);
}
_contentType = contentType;
}
Environement
Dart VM version: 1.1.3 (Thu Feb 06 00:05:52 2014) on "windows_ia32"
http package: http-0.9.2+3
The text was updated successfully, but these errors were encountered: