-
Notifications
You must be signed in to change notification settings - Fork 32
Detect cross-origin redirects during visits #70
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
Conversation
… https status codes.
…to the appropriate delegate.
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 great, nice work on this @svara.
Using Demo PR #12, I'm seeing the external redirect open in |
Hi! This is helpful, I've noticed this issue before as well, so thanks for resolving it! I was wondering, is there a way to handle this differently from within my application code? E.g., if I wanted to open this in a webview within my app, would there be a way to set that up? (At this point I don't know for sure if this would help me, but it's something I'm considering to handle a specific situation with my app.) Edit: Never mind, I don't have the same need anymore. But I'm just curious if there's something one can do here, because when I print out visit proposals in my |
@ibrahima while it's not currently possible, we're going to begin some work soon in the iOS library to make navigation more customizable through the same |
This PR is the counterpart of the Android hotwired/hotwire-native-android#82.
Due to CORS restrictions, the javascript Fetch API cannot be reliably used across applications to detect cross-origin redirects during Turbo visits.
This new approach hands off failed visits with a non-HTTP status code (which suggests a cross-origin redirect may have been attempted) to the native code to detect cross-origin redirects. If a visit redirect is detected, the final redirect location is treated as an external URL and opened appropriately.