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

Vt follow redirects #8522

Merged
merged 4 commits into from
Sep 12, 2023
Merged

Vt follow redirects #8522

merged 4 commits into from
Sep 12, 2023

Conversation

martrapp
Copy link
Member

Changes

With redirects, the location had to be updated to reflect the final destination in the browsers address bar.
Redirect errors, like same origin violation, are handled as any other errors of fetch by full load of the requested href
(as same origin policy would prevent us from accessing the target DOM)

While we are looking at the response object now, I have also grabbed the content-type for the parser.

Testing

two new e2e tests

Docs

n/a bug fix

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2023

🦋 Changeset detected

Latest commit: e6c9040

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 12, 2023
// If there is a problem fetching the new page, just do an MPA navigation to it.
if (!ok) {
if (!ok || contentType !== 'text/html') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so nice we have this in this PR too!

Copy link
Member Author

@martrapp martrapp Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as clever as thought, see fix in PR #8537

@matthewp matthewp merged commit 43bc5f2 into withastro:main Sep 12, 2023
@martrapp martrapp deleted the vt-follow-redirects branch September 12, 2023 16:56
@astrobot-houston astrobot-houston mentioned this pull request Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants