-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Instant loading should default to window.location
on 4xx status code
#3886
Comments
Thanks for suggesting, that definitely sounds like a valid use case and a good idea. |
This behavior is actually implemented, but it does not trigger because failing requests are currently just filtered: mkdocs-material/src/assets/javascripts/integrations/instant/index.ts Lines 193 to 200 in d219ae2
mkdocs-material/src/assets/javascripts/browser/request/index.ts Lines 49 to 57 in d219ae2
Instant loading is definitely in need of refactoring as already noted in #3797 since it kind of outgrew its initial architecture/design. I'm going to tackle this problem as well as part of the refactoring when I can allocate enough time. |
window.location
on 4xx status code
Fixed in 8beda2b. This is more of a mitigation than a proper fix, because as I noted – instant loading needs refactoring. However, it should fix the issue at hand, hopefully without introducing new problems, as I just moved the suboptimal error handling behavior downstream. |
This is amazing, thank you. If I can help in any way, let me know. Happy to put hands behind keyboards. :) |
Released as part of 8.2.14. |
Contribution guidelines
I want to suggest an idea and checked that ...
Description
Our organisation protects our static sites behind authentication based on a token stored as a cookie. This is implemented via lambda@edge on cloudfront, but equally applies to any other proxy that supports authentication. When the cookie / token expires, the XHR requests used by the instant integration silently fails and navigation breaks. I would expect this to be a fairly common use case, such as those used by backstage.io and private GitHub pages deployments in GHE.
The recommendation is to have the instant integration fallback to setting the window location, which would allow any proxies to correctly handle the redirects required to refresh the tokens, or to at least fail with an unauthorised error so the user knows what is going on, instead of silently failing.
Use Cases
Screenshots / Mockups
No response
The text was updated successfully, but these errors were encountered: