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

Fixed parsing of x-forwarded-* headers #12130

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

thehansys
Copy link

@thehansys thehansys commented Oct 5, 2024

Changes

This MR fixes parsing of x-forwarded-* headers such as x-forwarded-for, x-forwarded-host, x-forwarded-proto and x-forwarded-port. The current Astro version with node adapter cannot parse multiple values in these headers, for example x-forwarded-proto: https,http. This issue occurs when you run your Astro server behind two proxies, for example Cloudflare and then Nginx. All requests to SSR pages result in a 500 error in this case. Astro cannot be hosted with certain hosting providers because of this bug.

Testing

  • How to reproduce the bug with the current version: Just send request with following header "x-forwarded-proto: https,http" to any SSR page of Astro server with node adapter.
  • The change is covered by unit tests

Docs

  • This is bugfix. No change in documentation is needed.

Copy link

changeset-bot bot commented Oct 5, 2024

🦋 Changeset detected

Latest commit: ba12175

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 Oct 5, 2024
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.

1 participant