-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: set no-op proxy config to get Vite HTTPS working #12907
Conversation
🦋 Changeset detectedLatest commit: b604ea4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Vite is involved, this is a dev-only issue, right?
The issue we ran into before IIRC is that node-fetch
didn't like these headers. That became unnecessary when we switched to Undici.
The function you're modifying in this PR is the main function to generate the Request
object in production for various adapters for Node-based systems. This won't immediately make more work in production for apps using them (since the released version of the adapters bundle this code), but eventually it will.
Without looking much at what would be involved with this, my sense is that we should focus on the dev-time code, which would mean adjusting how getRequest
is called at
const request = await getRequest({ |
getRequest
implementation.
We may then also need to do something for preview-time. But we shouldn't be doing this extra work to normalize requests in prod builds if it's not necessary.
Turns out the better alternative was to set the no-op proxy config as implemented previously and is the current workaround. This also fixes another issue with the request URL being set incorrectly that the previous implementation had. I'm not sure if the config overriding is in the right place, but it doesn't seem to work if done too late such as immediately before configuring the dev and preview server. |
preview: https://svelte-dev-git-preview-kit-12907-svelte.vercel.app/ this is an automated message |
Awesome to close such a frequently encountered issue! Thanks!! |
closes #11365
cc: @Conduitry @benmccann
This PR gets the Vite HTTPS working again by filtering out two types of keys from the incoming request headers object before we pass it to a new
Request
object. Doing so prevents the two errors we currently encounter as shown below.Open to suggestions for a better way to do this.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits