You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[configgrpc, confighttp] Support lists of name/value pairs for headers (#13996)
#### Description
This PR introduces:
- A generic `MapList[T]` type, which is equivalent to `[]{ Name string,
Value T }`, but can be unmarshalled from a `map[string]T` as well. This
type is defined in a new `internal/maplist` package.
- A specialized version exported as `configopaque.MapList`
`configgrpc` and `confighttp` are changed to use this type instead of
`map[string]configopaque.String` for storing header configuration, so as
to be consistent with the SDK declarative config (see tracking issue).
Note that while this is relatively elegant, it causes a number of
breaking changes. An alternative would be to keep the current
`map[string]configopaque.String` types, and add an Unmarshal method on
the surrounding struct: see [this
PoC](jade-guiton-dd@fd4c11d).
#### Link to tracking issue
Fixes#13930
#### Testing
I added a basic unit test in `internal/maplist`.
---------
Co-authored-by: Pablo Baeyens <[email protected]>
Co-authored-by: Pablo Baeyens <[email protected]>
// CompressionAlgorithms configures the list of compression algorithms the server can accept. Default: ["", "gzip", "zstd", "zlib", "snappy", "deflate"]
0 commit comments