File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,8 @@ public actor KubernetesClient {
186186 configuration: HTTPClient . Configuration (
187187 tlsConfiguration: tlsConfiguration,
188188 redirectConfiguration: config. redirectConfiguration,
189- timeout: config. timeout
189+ timeout: config. timeout,
190+ decompression: config. gzip ? . enabled( limit: . none) : . disabled
190191 )
191192 )
192193 }
Original file line number Diff line number Diff line change @@ -417,6 +417,10 @@ internal extension RequestBuilder {
417417 headers. append ( ( " Authorization " , authorizationHeader) )
418418 }
419419
420+ if config. gzip {
421+ headers. append ( ( " Accept-Encoding " , " gzip " ) )
422+ }
423+
420424 return HTTPHeaders ( headers)
421425 }
422426}
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ public struct KubernetesClientConfig: Sendable {
3939 public let timeout : HTTPClient . Configuration . Timeout
4040 /// The default redirect configuration for the underlying `HTTPCLient`.
4141 public let redirectConfiguration : HTTPClient . Configuration . RedirectConfiguration
42+ /// Whether to request and decode gzipped responses from the API server.
43+ public let gzip : Bool
4244
4345 public init (
4446 masterURL: URL ,
@@ -47,7 +49,8 @@ public struct KubernetesClientConfig: Sendable {
4749 trustRoots: NIOSSLTrustRoots ? ,
4850 insecureSkipTLSVerify: Bool ,
4951 timeout: HTTPClient . Configuration . Timeout ,
50- redirectConfiguration: HTTPClient . Configuration . RedirectConfiguration
52+ redirectConfiguration: HTTPClient . Configuration . RedirectConfiguration ,
53+ gzip: Bool = false
5154 ) {
5255 self . masterURL = masterURL
5356 self . namespace = namespace
@@ -56,6 +59,7 @@ public struct KubernetesClientConfig: Sendable {
5659 self . insecureSkipTLSVerify = insecureSkipTLSVerify
5760 self . timeout = timeout
5861 self . redirectConfiguration = redirectConfiguration
62+ self . gzip = gzip
5963 }
6064}
6165
You can’t perform that action at this time.
0 commit comments