-
Notifications
You must be signed in to change notification settings - Fork 42
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
allow header and set header in client #222
allow header and set header in client #222
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
anyone can review this pr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems reasonable, but please add a test in http/client_test.go (see the first test as a good example).
@hunjixin: are you able to add the test so we can get this merged? |
@BigLep have tested |
Thanks. We're blocked on finding maintainer review time. It's in the queue though. |
// ClientWithHeaders specifies the HTTP header for the client. | ||
func ClientWithHeaders(key, value string) ClientOpt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
// ClientWithHeaders specifies the HTTP header for the client. | |
func ClientWithHeaders(key, value string) ClientOpt { | |
// ClientWithHeader adds an HTTP header to the client. | |
func ClientWithHeader(key, value string) ClientOpt { |
testClient := s.Client() | ||
tc.host = s.URL | ||
r := &cmds.Request{Path: tc.path, Command: &cmds.Command{}, Root: &cmds.Command{}} | ||
c := NewClient(tc.host, ClientWithHeaders(tc.header, tc.value)).(*client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c := NewClient(tc.host, ClientWithHeaders(tc.header, tc.value)).(*client) | |
c := NewClient(tc.host, ClientWithHeader(tc.header, tc.value)).(*client) |
Merged in #226 (addressing my review). Thanks! |
need send Authorization header to remote exec cmds.
allow header and support set header value in client