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(api-server): Preserve original host header for proxied API requests #10082

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

magJ
Copy link
Contributor

@magJ magJ commented Feb 29, 2024

Some apps rely on reading the host header(eg multi-tenant apps served over multiple subdomains).

The host header is no longer passed through after the API server was split from the web server.

Also vite doesn't pass through the host header when changeOrigin is true, which was fixed for development in #7811.

This change preserves the host header for proxied fastify API requests.

It also extends the change made in #7811, to the new experimental streaming SSR server.

@dac09

@jtoar jtoar added the release:fix This PR is a fix label Feb 29, 2024
@jtoar jtoar added this to the next-release-patch milestone Feb 29, 2024
@ahaywood
Copy link
Contributor

ahaywood commented Mar 1, 2024

Hey @magJ Thanks for taking the time to write and submit this PR! I'll pass it along for code review. 🙌

@dac09 dac09 self-assigned this Mar 7, 2024
@dac09 dac09 changed the title Preserve original host header for proxied API requests fix(api-server): Preserve original host header for proxied API requests Mar 7, 2024
Copy link
Collaborator

@dac09 dac09 left a comment

Choose a reason for hiding this comment

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

Thank you magnus! 🙌 🙌 ☮️ ✌️

@dac09 dac09 enabled auto-merge (squash) March 7, 2024 10:53
@dac09 dac09 merged commit 5c8d77f into redwoodjs:main Mar 7, 2024
41 checks passed
jtoar pushed a commit that referenced this pull request Mar 7, 2024
…ts (#10082)

Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>
@jtoar jtoar modified the milestones: next-release-patch, v7.1.1, v7.1.0 Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants