question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Charset get lost and casing of header keys changes

See original GitHub issue

Headers 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:closed
  • Created 8 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexMostcommented, Mar 15, 2019

I have checked this on my use case and seems like everything is ok! Thanks a lot!

1reaction
smhgcommented, Mar 14, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found