tests: Allow specifying http version in curl

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2023-03-14 15:43:59 +01:00
parent ae30e5c2fb
commit cbf819740e

View File

@ -36,6 +36,7 @@ type CURLReq struct {
Header string
Ciphers string
HttpVersion string
}
func (r CURLReq) timeoutDuration() time.Duration {
@ -57,6 +58,9 @@ func CURLPrefixArgs(clientURL string, cfg ClientConfig, CN bool, method string,
var (
cmdArgs = []string{"curl"}
)
if req.HttpVersion != "" {
cmdArgs = append(cmdArgs, "--http"+req.HttpVersion)
}
if req.IsTLS {
if cfg.ConnectionType != ClientTLSAndNonTLS {
panic("should not use cURLPrefixArgsUseTLS when serving only TLS or non-TLS")