-
Notifications
You must be signed in to change notification settings - Fork 1k
oauth2: handle nil headers in Transport.RoundTrip #779
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
base: master
Are you sure you want to change the base?
oauth2: handle nil headers in Transport.RoundTrip #779
Conversation
Fixes an issue where setting auth headers on requests with nil Headers would cause a panic. This change ensures that Transport.RoundTrip properly handles HTTP requests with nil headers by initializing the header map before setting the authorization header. Added a test case to verify this behavior as well. The bug was introduced in 696f7b3 Signed-off-by: Davanum Srinivas <[email protected]>
Found when trying to update Kubernetes to latest oauth2 version (v0.30.0): |
This PR (HEAD: be53fe7) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/oauth2/+/679317. Important tips:
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/679317. |
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/679317. |
Message from Davanum Srinivas (dims): Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/679317. |
Message from Davanum Srinivas (dims): Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/679317. |
Fixes an issue where setting auth headers on requests with nil Headers
would cause a panic.
This change ensures that Transport.RoundTrip properly handles HTTP
requests with nil headers by initializing the header map before setting
the authorization header. Added a test case to verify this behavior as well.
The bug was introduced in 696f7b3
cc @seankhliao (original author for review please)