Skip to content

[bug/feature] CORS preflight request incorrectly handled #149

@akomm

Description

@akomm
Q A
Bug report? yes
Feature request? yes
BC Break report? no
RFC? no
Version/Branch master

CORS preflight requests always fail with HTTP 400 response.

Overblog\GraphQLBundle\Controller\GraphController should check whether we have a CORS preflight request, before processing queries. This can be easily done checking whether the request method is 'OPTIONS'.

A CORS preflight request should result in an empty 200 response. So when we have method OPTIONS, return empty response and do not process queries. The empty response should also contain CORS headers. Maybe some defaults and configurable via extension.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions