ocaml-graphql-server icon indicating copy to clipboard operation
ocaml-graphql-server copied to clipboard

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

Open crackerli opened this issue 3 years ago • 4 comments

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

crackerli avatar Sep 18 '20 15:09 crackerli

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 🙂

andreas avatar Sep 18 '20 19:09 andreas

Thank you much for your quick reponse, andreas

crackerli avatar Sep 19 '20 01:09 crackerli

hi, andreas, when this issue can be fixed?

crackerli avatar Sep 22 '20 14:09 crackerli

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.

pm-mck avatar Dec 11 '21 14:12 pm-mck

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

patricoferris avatar Jan 26 '23 14:01 patricoferris