Closed ctavan closed 7 years ago
Thanks, @ctavan! Allowing this override seems like a very reasonable addition to me.
In terms of the interface, how would you feel about keeping cookieOptions
inside the existing options
list (instead of separating it out as an additional param)?
@rjz good idea! I'll change that and update the PR.
@rjz I've updated the PR. For the sake of completeness I have added the option to specify the 4th parameter script
to CookieAccessInfo
as well. It defaults to false
.
The API-change is indeed much less intrusive now, so I'm now also convinced that this is a useful addition.
Awesome, thank you! It's published to npm as 3.1.0.
Great, thanks for the quick merge!
By default supertest-session will derive the CookieAccessInfo config of the cookie jar from the agent configuration. There might be cases where you want to override this, e.g. if you're testing an service which is configured to run behind a proxy but which sets secure cookies.
I'm a bit unsure whether this addition really fits the scope of this module.
An alternative workaround which works fine for me is to simply provide a small wrapper for supertest-session:
Let me know how you feel about it. I'm equally happy to change the pull request and maybe just add the workaround to the README if you think this is valuable but don't wan to change anything about the functionality of supertest-session.