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

Prevent options object from being mutated. Fixes #230. #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theGrue
Copy link

@theGrue theGrue commented Jan 21, 2016

Restler freely mutates the contents of the options object, causing issues such as #230. This PR uses the already available mixin function to prevent this from happening, allowing multiple calls utilizing the same options object to function. I added two new tests as well, which did not pass before I made the change.

A possible regression due to this change could be a case where someone calls restler.get(url, options) followed by restler.request(url, options). Before this change was made, .get would have populated the options object and made it usable by the .request function, after this change, options will no longer be mutated by the call to .get so the subsequent .request may fail if the options were not sufficiently set in the first place. But I think the good outweighs the bad here, especially for POST/PUT/PATCH functions.

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.

1 participant