Skip to content

client: Client.buildRequest: use http.NewRequestWithContext#46171

Merged
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:client_context
Aug 10, 2023
Merged

client: Client.buildRequest: use http.NewRequestWithContext#46171
thaJeztah merged 3 commits intomoby:masterfrom
thaJeztah:client_context

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

client: Client.checkResponseErr: change errorMessage to an error

client: Client.Ping: re-use request when falling back to GET

Re-use the request, and change the method to GET instead of building
a new request "from scratch".

client: Client.buildRequest: use http.NewRequestWithContext

Attach the context to the request while we're creating it, instead of
creating the context first, and adding the context later.

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Aug 8, 2023
Re-use the request, and change the method to GET instead of building
a new request "from scratch".

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Attach the context to the request while we're creating it, instead of
creating the context first, and adding the context later.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah merged commit e0da5cb into moby:master Aug 10, 2023
@thaJeztah thaJeztah deleted the client_context branch August 10, 2023 19:00
@thaJeztah thaJeztah added this to the 25.0.0 milestone Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants