-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix redirects in Safari #11342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix redirects in Safari #11342
Conversation
…4 page instead of checking if we're on 404 via the API.
b5aed24 to
2d9c236
Compare
mhilbrunner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense and LGTM, giving Calinou final approval.
|
cc @Calinou |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Note that #11349 should be rebased to use this approach following this merge.
|
Thank you! Merged. |
|
Cherrypicked to 4.5 in #11448. |
Redirects currently don't work in Safari. The reason is that
window.performance.getEntries()[0].responseStatusis unsupported.Instead of checking in js whether we're 404-ing, I moved the script into the 404 page. This has the additional benefit that it is not loaded / run on any other pages except those that 404.
I tested the redirect (in Safari and Chrome) by changing
fetch("/en/latest/_static/redirects.csv")intofetch("/_static/redirects.csv"),inserting/404.html,/engine_details/file_formats/gdscript_grammar.htmlintoredirects.csv, and openinglocalhost:8001/404.html.