Multiple Set-Cookie headers on a static response object #16353
Unanswered
ARBrooks
asked this question in
Questions and Help
Replies: 1 comment 2 replies
-
I cannot provide any answer for you on this, but the error you are seeing is coming from here: cypress/packages/driver/src/cy/net-stubbing/static-response-utils.ts Lines 41 to 43 in 8e23567 It may just be that we need to make a feature request to support array headers in static responses. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've got a scenario where I'm stubbing an endpoint that sets multiple cookies on success via multiple set-cookie headers using the intercept API.
With a static response object, when you define a headers option it only enables you to define a single header/ set-cookie entry with the typings strictly only allowing strings, so if you have, for example:
Cypress throws and exception, but there's no alternative that I've seen to define the set-cookie, as a multiple with a stub. I've tried alternatives like hooking into the req/ res using the handler functions but this isn't fulfilling the upfront stub requirement as it appears to still allow the request through to the destination URL before modifying the response headers with our extra set-cookie headers.
Does anyone know of a suitable work around that will fulfil this use case?
Beta Was this translation helpful? Give feedback.
All reactions