question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to configure allowedOrigins on the graphql servlet for Cors requests?

See original GitHub issue

Firstly, big thanks for putting this altogether! Saved me a huge amount of time already.

From what I can see in GraphQLWebAutoConfiguration with graphql.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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oliemansmcommented, Apr 7, 2020

@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.

0reactions
oliemansmcommented, Dec 20, 2020

@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 WebMvcConfigurer. When using the configuration options as provided by the library it’ll create a CorsFilter bean which is used to protect the servlet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable CORS origin graphql - spring boot - Stack Overflow
For local development you may need a CorsFilter bean to enable your local origin: @Configuration @Profile("local") public class ...
Read more >
Configuring CORS - Apollo GraphQL Docs
This feature requires that any client sending operations via GET or multipart upload requests must include a special header (such as Apollo-Require-Preflight ) ......
Read more >
graphql-java-kickstart/Lobby - Gitter
I need to support queries and subscriptions. I'm a little lost on how to do that. Do I need to have both a...
Read more >
graphql-java-kickstart / graphql-spring-boot Download - JitPack
Enable GraphQL Servlet ; Enable GraphiQL; Enable Altair; Enable GraphQL ... /graphql cors-enabled: true cors: allowed-origins: http://some.domain.com ...
Read more >
UrlBasedCorsConfigurationSource.setAlwaysUseFullPath
How to use ... Best Java code snippets using org.springframework.web.cors. ... origin: com.graphql-java/graphql-spring-boot-autoconfigure ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found