diff options
| author | 2025-03-10 09:23:45 +0000 | |
|---|---|---|
| committer | 2025-03-10 09:23:45 +0000 | |
| commit | 252a17a691a316af8a1b0d960436c32257b4f66b (patch) | |
| tree | 3768a2a373f3a0e462b33ef389e30ce761dce5cb /vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go | |
| parent | [chore]: Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#3890) (diff) | |
| download | gotosocial-252a17a691a316af8a1b0d960436c32257b4f66b.tar.xz | |
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#3888)
Diffstat (limited to 'vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go')
| -rw-r--r-- | vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go index 60c2065dd..19255ec44 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go @@ -71,6 +71,7 @@ type ServeMux struct { routingErrorHandler RoutingErrorHandlerFunc disablePathLengthFallback bool unescapingMode UnescapingMode + writeContentLength bool } // ServeMuxOption is an option that can be given to a ServeMux on construction. @@ -258,6 +259,13 @@ func WithDisablePathLengthFallback() ServeMuxOption { } } +// WithWriteContentLength returns a ServeMuxOption to enable writing content length on non-streaming responses +func WithWriteContentLength() ServeMuxOption { + return func(serveMux *ServeMux) { + serveMux.writeContentLength = true + } +} + // WithHealthEndpointAt returns a ServeMuxOption that will add an endpoint to the created ServeMux at the path specified by endpointPath. // When called the handler will forward the request to the upstream grpc service health check (defined in the // gRPC Health Checking Protocol). |
