mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests: Allow specifying http version in curl
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
parent
ae30e5c2fb
commit
cbf819740e
@ -35,7 +35,8 @@ type CURLReq struct {
|
|||||||
Expected string
|
Expected string
|
||||||
Header string
|
Header string
|
||||||
|
|
||||||
Ciphers string
|
Ciphers string
|
||||||
|
HttpVersion string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r CURLReq) timeoutDuration() time.Duration {
|
func (r CURLReq) timeoutDuration() time.Duration {
|
||||||
@ -57,6 +58,9 @@ func CURLPrefixArgs(clientURL string, cfg ClientConfig, CN bool, method string,
|
|||||||
var (
|
var (
|
||||||
cmdArgs = []string{"curl"}
|
cmdArgs = []string{"curl"}
|
||||||
)
|
)
|
||||||
|
if req.HttpVersion != "" {
|
||||||
|
cmdArgs = append(cmdArgs, "--http"+req.HttpVersion)
|
||||||
|
}
|
||||||
if req.IsTLS {
|
if req.IsTLS {
|
||||||
if cfg.ConnectionType != ClientTLSAndNonTLS {
|
if cfg.ConnectionType != ClientTLSAndNonTLS {
|
||||||
panic("should not use cURLPrefixArgsUseTLS when serving only TLS or non-TLS")
|
panic("should not use cURLPrefixArgsUseTLS when serving only TLS or non-TLS")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user