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

RoundTrip: avoid modifying the original request #805

Merged
merged 4 commits into from Dec 21, 2017

Commits on Dec 6, 2017

  1. RoundTrip: avoid modifying the original request

    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.
    
    Hence, we get rid of cloneRequest method which wasn't working good for
    the needs of UnauthenticatedRateLimitedTransport.RoundTrip. Instead, now
    we have the implementation of cloneRequest inline in both the RoundTrip
    interfaces.
    
    We decided to make the cloneRequest implementation inline because of its
    use at only these two places and we think we won't gain much by making a
    generic implementation of cloneRequest as a function. To follow the
    discussion on this, check the GitHub issue -
    google#556.
    
    Fixes google#556
    sahildua2305 committed Dec 6, 2017
    Configuration menu
    Copy the full SHA
    b1cdce3 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2017

  1. Configuration menu
    Copy the full SHA
    f494e59 View commit details
    Browse the repository at this point in the history
  2. RoundTrip: minor fix

    Change []string(nil) to []string{} to make it easier to understand
    because the former isn't a common pattern in Go.
    sahildua2305 committed Dec 20, 2017
    Configuration menu
    Copy the full SHA
    bf9e675 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ac22a9a View commit details
    Browse the repository at this point in the history