Closed ascorbic closed 3 months ago
Latest commit: 1be0a1f263c63b158b175b071b47062f198a06d7
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
@ematipico thanks for the review. I've added comments answering both of your questions
Changes
The Vite dev server suppports HTTP/2 when the
server.https
option is set. However this doesn't work inastro dev
by default, because we set thevite.server.proxy
option (to an empty object). If a user manually enables it by unsetting the proxy option, we generate a malformedAstro.request.url
and SSR pages break because we try to set invalid headers.This PR removes the default proxy config so it is possible to enable HTTP/2 by setting the
vite.server.https
options. It handles URL correctly now, by chedking the:authority
pseudo-header as well ashost
, and ensures that we don't attempt to create invalid headers when we copy the headers object.Fixes #10238
Testing
It adds a test fixture based on the repro in #10238 (thanks @alexvuka1). In order to do this, I also added support for TLS and HTTP/2 in our test utils. If the fixture's Astro config enables https, the test utils configure fetch to trust self-signed certs and enable HTTP/2 in our tests.
Docs
I don't think this needs to be documented