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

fixes 857 - options object is mutated by calling request #891

Conversation

lalitkapoor
Copy link
Member

fixes #857.

@lalitkapoor lalitkapoor changed the title 857 options object is mutated by calling request fixes 857 - options object is mutated by calling request May 6, 2014
@mikeal
Copy link
Member

mikeal commented May 7, 2014

I remember there being some reason I mutated the options rather than copy them. But, seeing as though I don't remember why and I completely failed to document it I think we should merge this change.

Let's keep an eye on things to make sure we don't see any regressions.

Also, it might not be enough to just shallow copy option because some of the values get mutated (headers in particular).

mikeal added a commit that referenced this pull request May 7, 2014
…d-by-calling-request

fixes 857 - options object is mutated by calling request
@mikeal mikeal merged commit 9166a04 into request:master May 7, 2014
@lalitkapoor
Copy link
Member Author

@mikeal good point about the shallow copy. I could do a deep clone if that's better. or maybe just a JSON.stringify and JSON.parse of the options. Not sure about performance characteristics of one vs the other, if that's a concern.

@lalitkapoor lalitkapoor deleted the 857-Options-object-is-mutated-by-calling-request branch May 7, 2014 16:03
nylen pushed a commit to nylen/request that referenced this pull request Oct 17, 2014
…-mutated-by-calling-request

fixes 857 - options object is mutated by calling request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Options object is mutated by calling request
2 participants