Skip to content
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

encodeHeader filter #3230

Open
szuecs opened this issue Sep 17, 2024 · 0 comments
Open

encodeHeader filter #3230

szuecs opened this issue Sep 17, 2024 · 0 comments

Comments

@szuecs
Copy link
Member

szuecs commented Sep 17, 2024

Is your feature request related to a problem? Please describe.

A discussion in slack showed that there is a missing feature to change a string value encoding of headers if backend assumes a certain encoding.

Describe the solution you would like

I expect that this would solve the problem generic enough. It would read the value in header "X-Foo" decode by utf-8 and encode it with iso-8859-1 and replace the value of "X-Foo" header:

encodeHeader("X-Foo", "utf-8", "iso-8859-1")

Additional context (optional)

https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4

Historically, HTTP has allowed field content with text in the
ISO-8859-1 charset [ISO-8859-1], supporting other charsets only
through use of [RFC2047] encoding. In practice, most HTTP header
field values use only a subset of the US-ASCII charset [USASCII].
Newly defined header fields SHOULD limit their field values to
US-ASCII octets. A recipient SHOULD treat other octets in field
content (obs-text) as opaque data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant