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

Make BaseRequest (and subclasses) cloneable #103

Closed
tvolkert opened this issue Jun 27, 2017 · 3 comments
Closed

Make BaseRequest (and subclasses) cloneable #103

tvolkert opened this issue Jun 27, 2017 · 3 comments

Comments

@tvolkert
Copy link
Contributor

tvolkert commented Jun 27, 2017

For cases where you implement your own Client and override send(), it doesn't seem right to mutate the caller's request object.

It'd be better if BaseRequest were easily able to be copied. Not only would this allow you to keep from mutating the caller's object under their feet, but it would allow you to hide potentially sensitive information from the caller. e.g. in the use case that spawned this bug, the client is adding authentication headers to the request, and it's an explicit directive from the auth team that the scope of the OAuth token "leakage" be limited to auth libraries (that have undergone security review, etc.).

@tvolkert
Copy link
Contributor Author

Hmm - looks like this may already exist on master and just not be released yet?

@nex3
Copy link
Member

nex3 commented Jun 27, 2017

Yeah, this is one of the goals we're targeting for the refactoring @donny-dont is doing on master.

@nex3 nex3 closed this as completed Jun 27, 2017
@nicowernli
Copy link

Hi guys, this is an old request but I still can't see any of this in the library and I still think it should be part of the lib.

I think that a method like copy or copyWith replacing certain values of the request will be really usefull, specially if you want to automatically modify the request on the send method.

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

No branches or pull requests

3 participants