简体   繁体   中英

302 redirect loads blank page

We have an HTTP 302 redirect for some of our simulator pages as an async response implemented in Spring. As soon as the redirect response is received in the browser, blank page loads. However, if I load the redirect address manually (same URL as simulator, without parameters) the page loads properly.

However, this is the kicker:

In latest Chrome , I get blank page, and if I manually load the address (refresh doesn't work), it loads fine.

In newer Firefox (78.0.2) , my old page stays on screen, instead of blank page. Manual loading/repeating action works fine.

In older Firefox, (76.0) , everything works as expected, and redirect works in first go.

This makes me wonder if the issue is with Browser caching. So I added "cache-control: no-cache" as mentioned on MDN to my responses, but the problem remains.

Any suggestions on where the issue might be?

I recently had a similar situation with one of our apps when performing redirects. Same exact thing with the url working when manually entered into the browser (Chrome) but would not work when used as a redirect with the application. What worked for me was setting the status code to 302 instead of 200. Probably a long shot but maybe this will solve the issue.

I'm using 302 with the newer intent of "Found" instead of "Moved Temporarily." https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM