We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a82c61 commit bce8d70Copy full SHA for bce8d70
src/content/docs/rules/snippets/examples/override-set-cookies-value.mdx
@@ -20,10 +20,8 @@ export default {
20
const newHeaders = new Headers(response.headers);
21
22
// Get all Set-Cookie headers
23
- const cookies = response.headers.get("Set-Cookie");
24
- if (cookies) {
25
- // Split the Set-Cookie headers
26
- const cookieArray = cookies.split(/,(?=\s*[^;]+=[^;]+)/g);
+ const cookieArray = response.headers.getSetCookie();
+ if (cookieArray.length > 0) {
27
const updatedCookies = cookieArray.map((cookie) => {
28
// For example, replace the currency value with GBP
29
if (cookie.trim().startsWith("currency=")) {
0 commit comments