-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix TLSServerName for Node API Client #3127
Conversation
This PR fixes the construction of the TLSServerName when connecting to a node that has TLS enabled and adds tests for all possible permutations. Fixes #3013
api/api.go
Outdated
type nodeLookup func(nodeID string, q *QueryOptions) (*Node, *QueryMeta, error) | ||
|
||
// getNodeClientImpl is the implementation of creating a API client for | ||
// contacting a node. It is takes a function to lookup the node such that it can |
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.
"It is takes" :)
api/api.go
Outdated
@@ -316,6 +331,10 @@ func (c *Client) GetNodeClient(nodeID string, q *QueryOptions) (*Client, error) | |||
region = q.Region | |||
} | |||
|
|||
if region == "" { |
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.
This logic is a bit confusing with 329-332. Is there a way (case statement or "else if") to have region only be assigned a value once?
api/api.go
Outdated
return c.getNodeClientImpl(nodeID, q, c.Nodes().Info) | ||
} | ||
|
||
// nodeLookup is used to lookup a node |
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.
Maybe a bit more detail in the comment here
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR fixes the construction of the TLSServerName when connecting to a
node that has TLS enabled and adds tests for all possible permutations.
Fixes #3013
Fixes #3126