Quarkus Http Cors accept JSON

Viewed 1513

How should I configure the cors policy so it accepts json?

Access to XMLHttpRequest at 'http://localhost:8080/todo/savePerson' from origin 'http://localhost:4200' has been blocked by CORS policy:

Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

application.properties:

quarkus.http.cors=true
quarkus.http.cors.origins=http://localhost:4200
quarkus.http.cors.headers=accept, origin, authorization, content-type, x-requested-with
quarkus.http.cors.methods=GET,POST,OPTIONS
1 Answers

Yea, I tested it with Postman/Browser. I just deleted the rest and now it works for me.

quarkus.http.cors=true
Related