kumuluz / kumuluzee-cors

KumuluzEE CORS extension for Cross-Origin Resource Sharing (CORS) support.
https://ee.kumuluz.com
Other
1 stars 2 forks source link

Having issues with CORS #5

Closed samolego closed 5 months ago

samolego commented 5 months ago

Hi there,

I'm trying to figure out how to get CORS wrking. RN our webapp gets stuck due to no Access-Control-Allow-Origin header being present. I've checked the annotations and they seem to be correct to me:

@ApplicationScoped
@Path("initiatives")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@CrossOrigin(supportedMethods = "GET, POST, HEAD, DELETE, OPTIONS", exposedHeaders = "Access-Control-Allow-Origin, X-Total-Count")
public class InitiativesResource { ... }

The default value for origin is *, which should be fine. Do you know what I'm doing wrong?

Thank you :)!

samolego commented 5 months ago

I was missing .header(String) method on Response.