way to disable http2 (#1120)
* way to disable http2 * no option for netstand2.0
This commit is contained in:
@@ -27,6 +27,9 @@ namespace k8s
|
||||
CreateHttpClient(handlers, config);
|
||||
InitializeFromConfig(config);
|
||||
HttpClientTimeout = config.HttpClientTimeout;
|
||||
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
DisableHttp2 = config.DisableHttp2;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void ValidateConfig(KubernetesClientConfiguration config)
|
||||
|
||||
@@ -47,6 +47,10 @@ namespace k8s
|
||||
private HttpClientHandler HttpClientHandler { get; set; }
|
||||
#endif
|
||||
|
||||
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
private bool DisableHttp2 { get; set; }
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Initializes client properties.
|
||||
/// </summary>
|
||||
@@ -108,7 +112,10 @@ namespace k8s
|
||||
};
|
||||
|
||||
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
if (!DisableHttp2)
|
||||
{
|
||||
httpRequest.Version = HttpVersion.Version20;
|
||||
}
|
||||
#endif
|
||||
// Set Headers
|
||||
if (customHeaders != null)
|
||||
|
||||
@@ -103,5 +103,10 @@ namespace k8s
|
||||
#else
|
||||
public Action<HttpClientHandler> FirstMessageHandlerSetup { get; set; }
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Do not use http2 even it is available
|
||||
/// </summary>
|
||||
public bool DisableHttp2 { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user