feat: add response body limiter to routing HTTP client (#9478)
Gus Eggert committed
Dec 8, 2022 at 10:36 UTC
bf61e639e90b2db8bab110e453e7225108c25b71
1 file changed
+4
-1
routing/delegated.go
+4
-1
@@ -171,7 +171,10 @@ func httpRoutingFromConfig(conf config.Router, extraHTTP *ExtraHTTPParams) (rout
171
transport.MaxIdleConnsPerHost = 100
172
173
delegateHTTPClient := &http.Client{
174
- Transport: transport,
174
+ Transport: &drclient.ResponseBodyLimitedTransport{
175
+ RoundTripper: transport,
176
+ LimitBytes: 1 << 20,
177
+ },
178
}
179
180
key, err := decodePrivKey(extraHTTP.PrivKeyB64)