forked from google/go-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid modifying original request in RoundTrip. (google#805)
Avoid modifying the original request as per http.RoundTripper contract. In UnauthenticatedRateLimitedTransport.RoundTrip, we need to modify the URL of the request only, while in BasicAuthTransport.RoundTrip, we need to modify only the headers. We get rid of cloneRequest helper, which wasn't working well for the needs of UnauthenticatedRateLimitedTransport.RoundTrip. Instead, now we have the implementation of cloneRequest inlined in both RoundTrip methods. We decided to make the cloneRequest implementation inlined because its used at only these two places, and we think we won't gain much by making a generic implementation of cloneRequest as a function. For more information, see issue google#556. Fixes google#556.
- Loading branch information
1 parent
fbfee05
commit 1acce21
Showing
1 changed file
with
27 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters