Skip to content

GODRIVER-3373: Use non-default global DefaultTransport for DefaultClient#2110

Merged
zhouselena merged 4 commits into
mongodb:release/2.2from
zhouselena:GODRIVER-3373-2
Jul 2, 2025
Merged

GODRIVER-3373: Use non-default global DefaultTransport for DefaultClient#2110
zhouselena merged 4 commits into
mongodb:release/2.2from
zhouselena:GODRIVER-3373-2

Conversation

@zhouselena

Copy link
Copy Markdown
Contributor

GODRIVER-3373

Summary

NewHTTPClient returns a globally defined DefaultHTTPClient that returns DefaultTransport or updates the transport if it is replaced with a non-default transport.

Background & Motivation

Users can now use non-default transports without panic.

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot Bot added the review-priority-low Low Priority PR for Review: within 3 business days label Jun 21, 2025
@mongodb-drivers-pr-bot

Copy link
Copy Markdown
Contributor

API Change Report

No changes found!

@zhouselena zhouselena marked this pull request as ready for review June 23, 2025 15:47
Comment thread internal/httputil/httputil.go

func (*nonDefaultTransport) RoundTrip(*http.Request) (*http.Response, error) { return nil, nil }

func TestClientHTTPTransport(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a subtest for the default case?

@prestonvasquez prestonvasquez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@zhouselena zhouselena merged commit eac85d7 into mongodb:release/2.2 Jul 2, 2025
29 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-priority-low Low Priority PR for Review: within 3 business days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants