mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
fix: insert response cookies into request for redirect requests
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
**go version**
|
**go version**
|
||||||
|
|
||||||
- change: set http request timeout default to 120s
|
- change: set http request timeout default to 120s
|
||||||
|
- fix: insert response cookies into request for redirect requests
|
||||||
|
|
||||||
## v4.1.4 (2022-06-17)
|
## v4.1.4 (2022-06-17)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/cookiejar"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -29,6 +30,7 @@ func NewRunner(t *testing.T) *HRPRunner {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
t = &testing.T{}
|
t = &testing.T{}
|
||||||
}
|
}
|
||||||
|
jar, _ := cookiejar.New(nil)
|
||||||
return &HRPRunner{
|
return &HRPRunner{
|
||||||
t: t,
|
t: t,
|
||||||
failfast: true, // default to failfast
|
failfast: true, // default to failfast
|
||||||
@@ -37,6 +39,7 @@ func NewRunner(t *testing.T) *HRPRunner {
|
|||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
},
|
},
|
||||||
|
Jar: jar, // insert response cookies into request
|
||||||
Timeout: 120 * time.Second,
|
Timeout: 120 * time.Second,
|
||||||
},
|
},
|
||||||
http2Client: &http.Client{
|
http2Client: &http.Client{
|
||||||
|
|||||||
Reference in New Issue
Block a user