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(proxy): pass host for local targets #946

Merged
merged 3 commits into from
Jan 10, 2025
Merged

fix(proxy): pass host for local targets #946

merged 3 commits into from
Jan 10, 2025

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 10, 2025

resolves nitrojs/nitro#2985

regression with d4f863f was that for fetching URLs with relative path (only valid for nitro direct-fetch), we were skipping host header.

  • For external proxy, it makes sense to preserve the original host (previous fix)
  • For local targets /path there is virtually no host, so inherit makes sense. (this fix)

This PR fixes proxyRequest (used by nitro proxy route rules) and fetchWithEvent (used by nitro event.$fetch)

@pi0 pi0 changed the title fix(fetchWithEvent): pass host for local url fix(proxy): pass host for local url Jan 10, 2025
@pi0 pi0 changed the title fix(proxy): pass host for local url fix(proxy): pass host for local targets Jan 10, 2025
@pi0 pi0 merged commit de24917 into v1 Jan 10, 2025
3 checks passed
@pi0 pi0 deleted the fix/proxy-ev-host branch January 10, 2025 17:33
pi0 added a commit that referenced this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant