How can I set response header? I am getting this error The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.
public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader(
"Access-Control-Allow-Origin", "http://localhost:3000/");
response.setHeader(
"Access-Control-Allow-Credentials", "true");
chain.doFilter(req, response);
}```