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

Make Astro.redirect use a 302 status code #3700

Merged
merged 3 commits into from
Jun 24, 2022
Merged

Make Astro.redirect use a 302 status code #3700

merged 3 commits into from
Jun 24, 2022

Conversation

matthewp
Copy link
Contributor

Changes

  • Changes Astro.redirect to use a 302 redirect instead of 301.
  • 301 is permanent, but the use-case for Astro.redirect is to send someone to a login page, for example, and in that case you want the redirect to be temporary.

Testing

  • New test added.

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jun 24, 2022

🦋 Changeset detected

Latest commit: 86cc2cd

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

This PR includes changesets to release 1 package
Name Type
astro Patch

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 Jun 24, 2022
@@ -0,0 +1,3 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a callout on test fixtures going forward: due to a new noExternal dependency in Vite 3, we'll need to include a package.json with astro as a dependency for every test suite. Otherwise, Vite will fail to pre-bundle Astro. I'd recommend adding a package.json for this new suite as well!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, added one.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM once tests are passing!

@matthewp matthewp merged commit 47c81ef into main Jun 24, 2022
@matthewp matthewp deleted the redirect-302 branch June 24, 2022 19:55
@github-actions github-actions bot mentioned this pull request Jun 24, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* Make Astro.redirect use a 302 status code

* Adds a changeset

* Add a package.json
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.

None yet

3 participants