update go dependencies

This commit is contained in:
sammedsingalkar09
2026-03-06 11:24:00 +05:30
parent 751ba2e76e
commit e76287fbbf
201 changed files with 16709 additions and 76517 deletions

View File

@@ -28,7 +28,9 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal
}
handleForwardResponseServerMetadata(w, mux, md)
w.Header().Set("Transfer-Encoding", "chunked")
if !mux.disableChunkedEncoding {
w.Header().Set("Transfer-Encoding", "chunked")
}
if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil {
HTTPError(ctx, mux, marshaler, w, req, err)
return

View File

@@ -73,6 +73,7 @@ type ServeMux struct {
disablePathLengthFallback bool
unescapingMode UnescapingMode
writeContentLength bool
disableChunkedEncoding bool
}
// ServeMuxOption is an option that can be given to a ServeMux on construction.
@@ -125,6 +126,16 @@ func WithMiddlewares(middlewares ...Middleware) ServeMuxOption {
}
}
// WithDisableChunkedEncoding disables the Transfer-Encoding: chunked header
// for streaming responses. This is useful for streaming implementations that use
// Content-Length, which is mutually exclusive with Transfer-Encoding:chunked.
// Note that this option will not automatically add Content-Length headers, so it should be used with caution.
func WithDisableChunkedEncoding() ServeMuxOption {
return func(mux *ServeMux) {
mux.disableChunkedEncoding = true
}
}
// SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters.
// Configuring this will mean the generated OpenAPI output is no longer correct, and it should be
// done with careful consideration.