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

Retrofit clients use the wrong Content-Type for JSON #1134

Open
sfackler opened this issue Jun 27, 2019 · 2 comments
Open

Retrofit clients use the wrong Content-Type for JSON #1134

sfackler opened this issue Jun 27, 2019 · 2 comments

Comments

@sfackler
Copy link
Member

sfackler commented Jun 27, 2019

What happened?

A Retrofit-based client created via Retrofit2Client.create will send Content-Type: application/json; charset=UTF-8 as a header.

What did you want to happen?

The client should send Content-Type: application/json as specified in the Conjure spec: https://github.com/palantir/conjure/blob/master/docs/spec/wire.md#241-content-type-header

The content-type is set by Retrofit's JacksonRequestBodyConverter, so we'd probably need to make our own version.

@carterkozak
Copy link
Contributor

I don't think this violates the spec, the content-type header can contain parameters[1], which we've considered using to version the conjure wire protocol. Is something breaking based on the presence of parameters?

  1. https://www.w3.org/Protocols/rfc1341/4_Content-Type.html

@sfackler
Copy link
Member Author

The spec seems pretty unambiguous to me:

Otherwise, clients must use application/json.

It's breaking a Conjure server implementation that was built with an understanding that "must use application/json" meant that the value of the Content-Type header must be application/json.

@stale stale bot added the stale label Sep 23, 2019
@iamdanfox iamdanfox removed the stale label Sep 23, 2019
@palantir palantir deleted a comment from stale bot Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants