Cors in Ajax Meet 302 Redirect

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash 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 8080 server?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Um jqF CCx,9dfyrbtkCPYh5o 8v4hm36 wcjUToPgwt9sJF,7pGcqkV,uO,9390 8lVfHBAuH,Ry k 8V1l,e6SA7,Ra1m U6XuF6H
gD1,lHygSo7CYna5,zaY924LqeIcE5D2jw7fX R1L8

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham