Skip to content
Advertisement

Empty response after aplying CORS policy Springboot

When I don’t touch anything about CORS, the browser shows me the common error

Access to fetch at ‘http://localhost:8080/denodo-testwebapp/tags’ from origin ‘http://localhost:3000’ has been blocked by CORS policy

But meanwhile doing a GET petition on postman I recive the response with all the data

JavaScript

But when I try to disable CORS by adding this code:

JavaScript

I no longer have the browser error, but now, making the same GET petition on postman the response is empty and I don’t exactly know what is interfiering here

Advertisement

Answer

You need to forward the request/response pair down the FilterChain by calling chain.doFilter(request, response); at the end of your method.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement