Cors in Ajax Meet 302 Redirect
Clash Royale CLAN TAG #URR8PPP Cors in Ajax Meet 302 Redirect I have a front-end server with port 8081 a background server with port 8080(Spring MVC + shiro) When I send a request to 8080 , I have to set the cors headers on 8080 if the request is a simply request which only returns some json datas, it works But When the response status is 302, Chrome shows 'Redirect from 'http://localhost:8080/' to 'http://localhost:8080/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.' I thought there are two reasons to occur this problem: ① if I intercept this 302 status, and deal this response.headers.Location, I will solve this. But I can't intercept this response(with axios) ② Maybe some settings is wrong with 8080 server, when 302 occurs, the serve haven't set the cors Headers for this page. But I don't understand the backend code. So, ① is feasible? or I need to change the settings on 808...