quarkus: Can't configure Cors using YAML

Describe the bug

When using Yaml to configure Quarkus, it is impossible to properly configure cors.

This is due to the fact that you can either have:

quarkus:
  http:
    cors: true

or

quarkus:
  http:
    cors:
      origins: "*"

but not

quarkus:
  http:
    cors: true
      origins: "*"

The last example breaks the parser; as the quarkus.http.cors value cannot be both an object and a value in the YAML spec.

I might reccommed we move the flag to enable cors to quarkus.http.cors.enable, allowing the yaml to parse correctly.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.5.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

For those in a similar boat, you can use the following syntax to get around this issue:

quarkus:
  http:
    cors:
      ~: true
      origins: "*"

I still think the config parameter should be changed though