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

fix(prerender): skip redirects #1448

Merged
merged 1 commit into from
Jul 21, 2023
Merged

fix(prerender): skip redirects #1448

merged 1 commit into from
Jul 21, 2023

Conversation

Hebilicious
Copy link
Member

@Hebilicious Hebilicious commented Jul 17, 2023

πŸ”— Linked issue

Fix #1402
Resolves #1418

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

External links that returns 200 or 30x should be treated the same way.
We might need to add an additional check for external links.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #1448 (bd9c65a) into main (e87e2ba) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1448   +/-   ##
=======================================
  Coverage   76.17%   76.17%           
=======================================
  Files          73       73           
  Lines        7437     7439    +2     
  Branches      728      728           
=======================================
+ Hits         5665     5667    +2     
  Misses       1771     1771           
  Partials        1        1           
Impacted Files Coverage Ξ”
src/prerender.ts 86.98% <100.00%> (+0.07%) ⬆️

@Hebilicious Hebilicious requested a review from pi0 July 17, 2023 08:58
@Hebilicious Hebilicious added prerender enhancement New feature or request labels Jul 17, 2023
if (res.status !== 200) {
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
const redirectCodes = [301, 302, 303, 304, 307, 308];
if (![200, ...redirectCodes].includes(res.status)) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe as a feature we can try to follow redirects by checking Location header?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be nice yes. I think we can merge this and do it in a separated PR.

Copy link
Member

Choose a reason for hiding this comment

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

If not too much trouble introducing in same would be nice (so final changelog wouln't be a fix+feat)

Copy link
Member

Choose a reason for hiding this comment

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

/cc @Hebilicious are you still on this? Please let me know if needed help

Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't had the time to look, but I should have time to work on this in the upcoming days.

@pi0 pi0 changed the title feat: prerender supports redirects feat(prerender): handle redirects Jul 17, 2023
@pi0 pi0 changed the title feat(prerender): handle redirects fix(prerender): skip redirects Jul 21, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Let's merge and progress...

@pi0 pi0 merged commit 0bd8662 into main Jul 21, 2023
7 checks passed
@pi0 pi0 deleted the prerender-redirect branch July 21, 2023 08:47
@pi0 pi0 mentioned this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prerender
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prerender should skip or followup redirects Prerendering a page that uses navigateTo results in an error
2 participants