Akka rejects requests when UTF-8 charset is explicitly specified in Accept header along with `application/json` #1139

Closed
Leammas opened this Issue May 17, 2017 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

Leammas commented May 17, 2017 edited

The problem occurred after updating to 10.0.6 from 10.0.5. I've made failing unit test here:
Leammas/akka-http@194378e

According to iana the "charset" parameter should not affect compatibility.

The problem was introduced here but I'm not sure how to fix it without breaking new Accept-handling behavior

jrudolph added the 0 - new label May 17, 2017

Member

jrudolph commented May 17, 2017

The behavior you describe is implemented when the charset parameter is offered using the Accept-Charset header. However, RFC 7231, section 5.3.2 explicitly mentions that charset is an allowed parameter to put into the Accept-header as well so arguably putting it there instead of using Accept-Charset should make no difference.

That means, we might need to treat the charset parameter in the Accept header specially. @raboof wdyt?

Member

jrudolph commented May 17, 2017

Maybe we could improve the line at 4758a44#diff-95adf484e1280a1b0d76142e2901b916R98, to check a mediarange charset parameter against the charset given in the fixed charset mediatype?

Contributor

Leammas commented May 17, 2017

Is the solution suggested in the PR #1140 acceptable?

@jrudolph jrudolph added a commit that referenced this issue Jun 12, 2017

@jrudolph jrudolph =htc #1139 Ignore `charset` param in `Accept` header during content n…
…egotiation (#1140)

Instead, clients should use `Accept-Charset` to negotiate the charset.
a149cf0

jrudolph added this to the 10.0.8 milestone Jun 12, 2017

Member

2m commented Jun 20, 2017

Fixed in #1140

2m closed this Jun 20, 2017

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