Closed tsts83 closed 6 years ago
Hi @tsts83. Can you please attach an example of the tape that you're generating? I just tested a dummy example with multiple Set-Cookies in the response and it worked, so I might be missing something.
Thank you
Sure:
{ meta: { createdAt: "2018-05-09T07:48:08.621Z", host: "https://abcdefgh.com", reqHumanReadable: true }, req: { url: "/v1", method: "GET", body: "" }, res: { status: 200, headers: { "Set-Cookies": [ "123456789" ], "Set-Cookies": [ "abcdefghij" ] }, body: "" } }
Response header in browser:
HTTP/1.1 200 OK Set-Cookies: abcdefghij Date: Wed, 23 May 2018 08:27:23 GMT Connection: keep-alive Transfer-Encoding: chunked
In res
there should only be one Set-Cookies
header with all the values in the array.
{
"meta": {
"createdAt": "2018-05-09T07:48:08.621Z",
"host": "https://abcdefgh.com",
"reqHumanReadable": true
},
"req": {
"url": "/v1",
"method": "GET",
"body": ""
},
"res": {
"status": 200,
"headers": {
"Set-Cookies": [
"123456789",
"abcdefghij"
]
},
"body": ""
}
}
Thanks! This is what I was looking for.
One last question. Is it possible to ignore query parameters when matching url? E.g.: /v1/something.js?_=1527150278045 - so in this case ignore the number ( which is changing ) and use the tape based on the url only.
Glad it worked!
No, right now URLs have to be an exact match. I'll keep it in mind for a possible feature.
@tsts83 I just published v1.3.0 which adds the ignoreQueryParams
option.
Hope it helps :)
Hi,
I'm trying to mock a response with multiple "Set-Cookies" header. As I saw, only the last 'Set-Cookies' entry in the file gets sent in the response. So instead of e.g. 5 Set-Cookies header, I get only one. Can this be a bug, or do I need to address this in some special way in the json5 file?
Thanks, Sandor