We have a front-end application which fetches data from a GraphQL server. The GraphQL server needs to serve responses with proper CORS headers, which is configured via HAPROXY_0_BACKEND_HEAD in the GraphQL server's Marathon app descriptor. The GraphQL server has HTTP => HTTPS redirects enabled.
Marathon-LB specific labels defined in the GraphQL server's Marathon app descriptor (reformatted to make more readable):
Before allowing a request to the GraphQL server the browser will first perform a preflight check by doing an OPTIONS requests. This fails (most of the time) because the CORS headers are not included in the response. The reason seems to be that the request is not always served by the GraphQL server backend.
$ http OPTIONS https://app.example.org/graphql
HTTP/1.1 302 Found
Cache-Control: no-cache
Connection: close
Content-length: 0
Location: https://app.example.org/graphql
GET requests are usually fine, but I've seen issues with that for a previous (unreleased) version of Marathon we were using.
We have a front-end application which fetches data from a GraphQL server. The GraphQL server needs to serve responses with proper CORS headers, which is configured via
HAPROXY_0_BACKEND_HEAD
in the GraphQL server's Marathon app descriptor. The GraphQL server has HTTP => HTTPS redirects enabled.Marathon-LB specific labels defined in the GraphQL server's Marathon app descriptor (reformatted to make more readable):
Before allowing a request to the GraphQL server the browser will first perform a preflight check by doing an
OPTIONS
requests. This fails (most of the time) because the CORS headers are not included in the response. The reason seems to be that the request is not always served by the GraphQL server backend.GET
requests are usually fine, but I've seen issues with that for a previous (unreleased) version of Marathon we were using.Our current workaround is the following change to
marathon_lb.py
, but I am wondering if there is some configuration we are missing.System info: