Open emillon opened 4 years ago
Hi,
When the client is on a different origin than the server, the client sends a preflight OPTIONS request to OGS, which returns a 404:
https://github.com/andreas/ocaml-graphql-server/blob/940e86f9ff1a017be2ff64b3a35c71804d9a4729/graphql-cohttp/src/graphql_cohttp.ml#L188
That prevents directly using make_callback in this scenario.
make_callback
What do you think about adding a ?allowed_origins optional parameter that adds the right handler to OPTIONS /graphql? I'm happy to provide a patch.
?allowed_origins
OPTIONS /graphql
Thanks!
Yes, that would be great 😄
Hi,
When the client is on a different origin than the server, the client sends a preflight OPTIONS request to OGS, which returns a 404:
https://github.com/andreas/ocaml-graphql-server/blob/940e86f9ff1a017be2ff64b3a35c71804d9a4729/graphql-cohttp/src/graphql_cohttp.ml#L188
That prevents directly using
make_callback
in this scenario.What do you think about adding a
?allowed_origins
optional parameter that adds the right handler toOPTIONS /graphql
? I'm happy to provide a patch.Thanks!