ocaml-graphql-server
ocaml-graphql-server copied to clipboard
The server will reject the request from okhttp and dart-lang http
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.
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 🙂
Thank you much for your quick reponse, andreas
hi, andreas, when this issue can be fixed?
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.
#204 was merged, so this should be fixed now thanks @pm-mck