Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
RoundTrip: avoid modifying the original request #805
Avoid modifying the original request as per http.RoundTripper contract.
Hence, we get rid of cloneRequest method which wasn't working good for
We decided to make the cloneRequest implementation inline because of its
@shurcooL I am struggling with tests for this change. I tried this -
However, that doesn't work because RoundTrip request itself fails.
I don't think this change needs a test. We'll just review it carefully to ensure that the
Thanks for implementing a fix for this @sahildua2305.
Unfortunately, it's not looking as readable as I was hoping it would, but I'm not able to come up with any better alternatives even after spending some time trying. I think it's acceptable in the end (and the
http.RoundTripper contract is to blame for this).
Everything looks correct to me. Two minor suggestions, otherwise LGTM. But I'll ask for a second review just in case I missed something.