-
Notifications
You must be signed in to change notification settings - Fork 326
Any way to configure allowedOrigins on the graphql servlet for Cors requests? #376
Comments
It's not configurable at the moment. I added this for the next release. You'll be able to use the property |
Awesome, thanks @oliemansm! Looking forward to 7.1.0 being released. |
@Mrman You could try it out already with snapshot 7.1.0-SNAPSHOT if you want to. Just add the snapshot repository to your project: https://github.com/graphql-java-kickstart/graphql-spring-boot#snapshots. |
Will it work if I override addCorsMappings() in CorsConfiguration and @EnableWebFlux? UPDATE: |
Why is it not just possible to configure using the Web MVC Configuration like this: @Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/graphql").allowedOrigins("http://someOtherOrigins");
}
};
} |
@Thinkenterprise It's just by chance I'm seeing this comment on the closed issue, but we generally don't notice these. Since we've enabled Discussions on the projects, best next time to ask the question there and link it to this issue. Having said that I'm not sure what'll happen when you configure it using |
Uh oh!
There was an error while loading. Please reload this page.
Firstly, big thanks for putting this altogether! Saved me a huge amount of time already.
From what I can see in
GraphQLWebAutoConfiguration
withgraphql.servlet.corsEnabled=true
uses the default permit all:CorsConfiguration corsConfiguration = new CorsConfiguration().applyPermitDefaultValues();
Am I missing where I can configure the allowedOrigins for Cors requests through config or is this not currently supported?
Cheers
The text was updated successfully, but these errors were encountered: