Charset get lost and casing of header keys changes
See original GitHub issueHeaders act weird:
var translation = {
charset: "UTF-8",
headers: {
"Project-Id-Version": "project 1.0.2",
"Mime-Version": "1.0",
"Content-Type": "text/plain; charset=UTF-8",
"Content-Transfer-Encoding": "8bit",
"Plural-Forms": "nplurals=2; plural=(n!=1);",
"X-Poedit-SourceCharset": "UTF-8"
},
translations: {}
}
And the generated files outputs:
msgid ""
msgstr ""
"Project-Id-Version: project 1.0.2\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
"X-Poedit-Sourcecharset: UTF-8\n"
"Content-Type: text/plain;\n"
As you can see, Content-Type
header lacks the charset and then the X-Poedit-SourceCharset
header casing is weird and confuses 3rd party editors, it becomes X-Poedit-Sourcecharset
Can’t the headers be sent as they are ? Without any magic title casing ?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Header keys lose their case · Issue #1561 · psf/requests - GitHub
it seems that there is a bug in response.headers. for example, code below: import requests r ... Header keys lose their case #1561....
Read more >Are HTTP headers case-sensitive? - Stack Overflow
Header names are not case sensitive. From RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers": Each header field consists ......
Read more >HTTP/1.1: Header Field Definitions
The Accept-Charset request-header field can be used to indicate what character sets are acceptable for the response. This field allows clients capable of ......
Read more >HTTP headers - MDN Web Docs - Mozilla
An HTTP header consists of its case-insensitive name followed by a colon ( : ), then by its value. Whitespace before the value...
Read more >Back to Basics: Custom HTTP Response Header Manipulation ...
This post is specifically about the response data, but headers are both for request and response are always assigned as key value pairs....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have checked this on my use case and seems like everything is ok! Thanks a lot!
Released on npm as
4.0.0-alpha.0
. @iongion @FredyC @vallo87 @AlexMost it would be great if one of you could give it a try.