Skip to content
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

Connect HTTP Get support #478

Merged
merged 13 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions client_ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ func TestClientPeer(t *testing.T) {
t.Parallel()
run(t,
connect.WithHTTPGet(),
connect.WithHTTPGetMaxURLSize(256, false),
connect.WithSendGzip(),
)
})
t.Run("connect+get fallback", func(t *testing.T) {
t.Parallel()
run(t,
connect.WithHTTPGet(),
connect.WithHTTPGetMaxURLSize(1, true),
jchadwick-buf marked this conversation as resolved.
Show resolved Hide resolved
connect.WithSendGzip(),
)
})
Expand Down
8 changes: 6 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func WithHTTPGet() ClientOption {
return &enableGet{}
}

// WithHTTPGetMaxURLSize sets the maximum allowable URL length for GET requests
// withHTTPGetMaxURLSize sets the maximum allowable URL length for GET requests
// made using the Connect protocol. It has no effect on gRPC or gRPC-Web
// clients, since those protocols are POST-only.
//
Expand All @@ -278,10 +278,14 @@ func WithHTTPGet() ClientOption {
//
// By default, Connect-protocol clients with GET requests enabled may send a
// URL of any size.
func WithHTTPGetMaxURLSize(bytes int, fallback bool) ClientOption {
func withHTTPGetMaxURLSize(bytes int, fallback bool) ClientOption {
return &getURLMaxBytes{Max: bytes, Fallback: fallback}
}

// TODO(jchadwick-buf): Remove this once we've determined whether this option
// should be exported or removed.
var _ = withHTTPGetMaxURLSize(0, false)
jchadwick-buf marked this conversation as resolved.
Show resolved Hide resolved

// WithInterceptors configures a client or handler's interceptor stack. Repeated
// WithInterceptors options are applied in order, so
//
Expand Down