Unable to parse ContentType with charset

Ok, so I am unsure if it is a bug but in my opinion it is not a desired behaviour:

Steps to reproduce:

  1. Create a request for query any would do
  2. In the header make sure value is ContentType: application/json; charset=utf-8
  3. Execute the query.
  4. The server complains the request sent is not application/json and ask for it.

In reality, the charset is utf-8 by default, however this should not result dgraph complaining the request is not application/json as it. The server should be smart enough to handle that in my humble opinion.

Regards
Harshad

5 Likes

Yeah! this would happen at both /query and /mutate endpoint.

Thanks @harshadbhatia for pointing it out.

I guess this needs to be checked at every public endpoint we are exposing. We need to correctly parse content types.

Hey @harshadbhatia,

Thanks for pointing this out. I’ve fixed it here.