Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use sinon due to fake server unsafe cookie checks #1061

Closed
andpor opened this issue Jun 3, 2016 · 1 comment
Closed

Unable to use sinon due to fake server unsafe cookie checks #1061

andpor opened this issue Jun 3, 2016 · 1 comment

Comments

@andpor
Copy link
Contributor

andpor commented Jun 3, 2016

Hi,

Currently sinon seems to have hardcoded logic to check http requests for unsafe cookies and rejects the headers should they match what is considered unsafe. There is no way to disable this check in case there is a need for it which renders the fake server with http request unusable.

It would be great to make this configurable, enabled by default.

I implemented a code change where unsafeCookieCheckEnabled property is added to sinon, defaulting to true but overridable by user code. The code in FakeXMLHtppRequest then checks this property value before engaging in unsafeCookie check.

2 lines of code change. Backward compatible and safe.

Should I go ahead and create a PR for this?

P.S. I have a React Native PR outstanding for a few days. Are you planning on merging it in or you se issues with the code or not finding the functionality particularly useful?

@fatso83
Copy link
Contributor

fatso83 commented Jun 4, 2016

This seems useful, but try to make it a non-global change. In other words, change the factory method creating the server to accept such an option. I haven't looked at the code, so details may be off...

Regarding your pull request : this happens. We only do this voluntarily so things can take some time. Your team could always just use your fork while waiting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants