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 endpoint response with immutable header #9876

Merged
merged 11 commits into from
Jan 30, 2024

Conversation

friedemannsommer
Copy link
Contributor

@friedemannsommer friedemannsommer commented Jan 30, 2024

Changes

Updated the implementation of renderEndpoint to only append the reroute header if the response has the HTTP status code 404 or 500.
This should resolve the issue mentioned in #9871.

Testing

Added tests based on the work of @lilnasy (cad43ea5c11e58b022df82907cd110e56dd4efed).
These tests check that the response returned from an endpoint contains the expected headers and doesn't error with an HTTP 500 error.

Docs

I don't think there is a need to update the documentation because of this change, since it's only internal response rewriting.

Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: 20106a5

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 Jan 30, 2024
@lilnasy lilnasy linked an issue Jan 30, 2024 that may be closed by this pull request
1 task
Copy link
Contributor

@lilnasy lilnasy left a comment

Choose a reason for hiding this comment

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

Looks great to me! The tests are a welcome addition, thanks.

I will merge soon as the tests pass.

@lilnasy lilnasy merged commit e9027f1 into withastro:main Jan 30, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 30, 2024
@friedemannsommer friedemannsommer deleted the friedemannsommer/issue9871 branch January 30, 2024 17:17
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.

Endpoint Response.redirect header modification
3 participants