Skip to content
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

Relative frame src not resolved properly when prefetched on hover that results in 302 #1392

Open
kuba-orlik opened this issue Apr 2, 2025 · 0 comments

Comments

@kuba-orlik
Copy link

There's a link in a navbar with href pointing to /a

The /a endpoint redirects with 302 to /a/b/

The HTML returned by /a/b/ includes a turbo-frame with src set to a relative url: ./frame.

When opening a new tab and visiting the /a/b endpoint directly, the frame loads properly - the browser requests the /a/b/frame URL.

However, when the user starts on the homepage (/), and then clicks on a link that points to /a, the /a/b/ page appears, but the frame tries to load from /frame instead of /a/b/frame.

It seems that when turbo is prefetching the HTML and parsing the incoming HTML, the relative URLs are parsed relative to the URL that the user is currently on - not the URL that the redirect leads to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant