Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

CORS functionality cannot be disabled with property 'graphql.servlet.cors-enabled' #763

@bvklingeren

Description

@bvklingeren

Describe the bug

The GraphQLWebAutoConfiguration class contains a 'corsConfigurer' bean factory method which has a @ConditionalOnProperty annotation with the value of 'graphql.servlet.corsEnabled'. This does not match with the 'graphql.servlet.cors-enabled' config parameter which is the expected format of such a property and therefore it doesn't prevent the CorsFilter to be created when you define the 'graphql.servlet.cors-enabled' config parameter with the value 'false'.

To Reproduce
Steps to reproduce the behavior:

  1. Register config param 'graphql.servlet.cors-enabled' in e.g. application.properties with value 'false'
  2. Create a breakpoint at line 127 of GraphQLWebAutoConfiguration
  3. Start your SB app in debug mode
  4. The debugger stops at the breakpoint

Expected behavior
The breakpoint should not have been reached and therefore the CorsFilter should not have been created.

Screenshots
N/a

Desktop (please complete the following information):
N/a

Additional context
N/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions