Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Akka incorrectly assumes UTF-8 for incoming text/xml media type without charset #1134
Comments
jypma
added 0 - new discuss t:model
labels
May 16, 2017
|
Thanks, @jypma. I think the problem is that the For outgoing HTTP messages that seems like a sensible default but for incoming messages we decide directly in the parser to use UTF-8 as the default if none else is given: https://github.com/akka/akka-http/blob/5932237a86a432d623fafb1e84eeeff56d7485fe/akka-http-core/src/main/scala/akka/http/impl/model/parser/ContentTypeHeader.scala#L31-L31 |
|
Right, thanks for the link. My use case: we're using akka-http in a proxy, and would like to pass on the incoming request as unmodified as possible. Currently it turns Since it's a legal (but discouraged) content type, how about adding |
You still wouldn't know if the charset originally came with the request or if a default was added later in the parser. We have a few potential solutions:
|
jrudolph
added 1 - triaged binary-incompatible community and removed 0 - new
labels
May 16, 2017
|
I like them both. I think I'll give a go at option 2. I hope the compiler will nudge me if I forget a case. |
|
|
|
@jrudolph what's |
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 17, 2017
|
|
jypma |
8b1014a
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 17, 2017
|
|
jypma |
e6dabf8
|
ktoso
referenced
this issue
May 17, 2017
Merged
Fix #1134: Create representation of Content-Type with missing charset #1141
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 18, 2017
|
|
jypma |
21ffe7a
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 22, 2017
|
|
jypma |
0ec7053
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 22, 2017
|
|
jypma |
1e02b7b
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 24, 2017
|
|
jypma |
4383d5d
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 29, 2017
|
|
jypma |
1e9bad6
|
jypma
added a commit
to jypma/akka-http
that referenced
this issue
May 29, 2017
|
|
jypma |
eb629bd
|
jrudolph
closed this
in c3b6705
May 31, 2017
jrudolph
added a commit
that referenced
this issue
May 31, 2017
|
|
jrudolph |
c22ebcf
|
jypma commentedMay 16, 2017
According to iana, the
text/xmlmedia type'scharsetproperty is optional.When creating a
ContentTypein akka itself, as the http client, we currently require providing a charset fortext/xml, which is a great recommendation.However, as a server, we can't control what clients send. But an incoming request which just has
Content-Type: text/xmlis now represented asContentType(text/xml, charset=UTF-8), e.g.and the client:
where I would have hoped to see a
ContentTypewithmediaTypetext/xmlandcharsetOptionofNone.