andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
624 stars 60 forks source link

The server will reject the request from okhttp and dart-lang http #196

Closed crackerli closed 1 year ago

crackerli commented 3 years ago

hi, andreas:

Some of the http lib like okhttp, dart-lang http will append "charset=utf-8" to header "Content-Type" automatically, it will cause the rejection of ocaml-graphql-server, but pity hard to remove it from "Content-Type". Now I use apollo-android and graphql-flutter to develop some app connect to ocaml-graphql-server, I find no workaround to fix it by my side.

Maybe it is easy for server side to change? Sorry for I have on ocaml knowledge. I just add some test code like below, and it works for me in my app.

image

andreas commented 3 years ago

Hey @crackerli - yeah, this should be fixed server side. It looks like Cohttp has a method to extract the content type without the charset: Header.get_media_type.

Thanks for reporting 🙂

crackerli commented 3 years ago

Thank you much for your quick reponse, andreas

crackerli commented 3 years ago

hi, andreas, when this issue can be fixed?

pm-mck commented 2 years ago

I made a PR #204 to address this issue (we just hit it too while making a Terraform provider). Let me know if there's anything else needed to get it merged in.

patricoferris commented 1 year ago

204 was merged, so this should be fixed now thanks @pm-mck