astro/packages/integrations/node/test
Alex Sherwin 4929332c32
#7226 - fixes NodeJS adapter for multiple set-cookie headers (and other header issues) (#7227)
* Utilizes the new standard WebAPI Fetch Headers.getSetCookie() function
to safely handle multiple set-cookie headers when converting from a
WebAPI Response to a NodeJS ServerResponse

Modifies the existing nodeMiddleware logic which first set AstroCookies
on ServerResponse.setHeader(...) and then called
ServerResponse.writeHead(status, Response.headers) which means any that
if the WebAPI Response had any set-cookie headers on it, they would
replace anything from AstroCookies.

The new logic delegates appending AstroCookie values onto the WebAPI
Response Headers object, so that a single unified function safely
converts the WebAPI Response Headers into a NodeJS compatible
OutgoingHttpHeaders object utilizing the new standard
Headers.getSetCookie() function provided by the undici WebAPI polyfills.

Plus extensive test coverage.

* #7226 - changeset for NodeJS adapter set-cookie fix

* fixing all double quotes to single quotes

---------

Co-authored-by: Alex Sherwin <alex.sherwin@acadia.inc>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-06-06 10:09:16 -05:00
..
fixtures #7226 - fixes NodeJS adapter for multiple set-cookie headers (and other header issues) (#7227) 2023-06-06 10:09:16 -05:00
api-route.test.js [ci] format 2023-01-10 17:01:27 +00:00
bad-urls.test.js fix(node): Fix malformed URLs crashing the server in certain cases (#6746) 2023-04-04 15:48:28 +02:00
createOutgoingHttpHeaders.test.js #7226 - fixes NodeJS adapter for multiple set-cookie headers (and other header issues) (#7227) 2023-06-06 10:09:16 -05:00
encoded.test.js [ci] format 2023-01-12 15:46:47 +00:00
errors.test.js Catch errors that occur within the stream in the Node adapter (#6935) 2023-05-01 10:08:18 -04:00
headers.test.js.js #7226 - fixes NodeJS adapter for multiple set-cookie headers (and other header issues) (#7227) 2023-06-06 10:09:16 -05:00
node-middleware.test.js [ci] format 2023-01-10 17:01:27 +00:00
prerender.test.js fix:query not considered in directory redirection (#7243) 2023-06-06 10:09:00 -05:00
test-utils.js fix(core): handle encoded characters when matching routes (#5836) 2023-01-12 09:44:18 -06:00
url-protocol.test.js Fix Astro.url.protocol when using the @astrojs/node SSR adapter with HTTPS (#5992) 2023-01-26 12:39:57 -05:00
well-known-locations.test.js Add support for serving well-known URIs with the @astrojs/node SSR adapter (#5832) 2023-01-11 17:52:51 +08:00