fix: integration test with Go v1.20.6
This commit is contained in:
parent
2df5defd36
commit
00048a8351
1 changed files with 8 additions and 1 deletions
|
@ -1140,6 +1140,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
|
||||||
desc string
|
desc string
|
||||||
hostHeader string
|
hostHeader string
|
||||||
serverName string
|
serverName string
|
||||||
|
expectedError bool
|
||||||
expectedContent string
|
expectedContent string
|
||||||
expectedStatusCode int
|
expectedStatusCode int
|
||||||
}{
|
}{
|
||||||
|
@ -1161,6 +1162,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
|
||||||
desc: "Spaces after the host header",
|
desc: "Spaces after the host header",
|
||||||
hostHeader: "site3.www.snitest.com ",
|
hostHeader: "site3.www.snitest.com ",
|
||||||
serverName: "site3.www.snitest.com",
|
serverName: "site3.www.snitest.com",
|
||||||
|
expectedError: true,
|
||||||
expectedContent: "server3",
|
expectedContent: "server3",
|
||||||
expectedStatusCode: http.StatusOK,
|
expectedStatusCode: http.StatusOK,
|
||||||
},
|
},
|
||||||
|
@ -1175,6 +1177,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
|
||||||
desc: "Spaces after the servername and host header",
|
desc: "Spaces after the servername and host header",
|
||||||
hostHeader: "site3.www.snitest.com ",
|
hostHeader: "site3.www.snitest.com ",
|
||||||
serverName: "site3.www.snitest.com ",
|
serverName: "site3.www.snitest.com ",
|
||||||
|
expectedError: true,
|
||||||
expectedContent: "server3",
|
expectedContent: "server3",
|
||||||
expectedStatusCode: http.StatusOK,
|
expectedStatusCode: http.StatusOK,
|
||||||
},
|
},
|
||||||
|
@ -1223,7 +1226,11 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
|
||||||
req.Host = test.hostHeader
|
req.Host = test.hostHeader
|
||||||
|
|
||||||
err = try.RequestWithTransport(req, 500*time.Millisecond, &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true, ServerName: test.serverName}}, try.StatusCodeIs(test.expectedStatusCode), try.BodyContains(test.expectedContent))
|
err = try.RequestWithTransport(req, 500*time.Millisecond, &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true, ServerName: test.serverName}}, try.StatusCodeIs(test.expectedStatusCode), try.BodyContains(test.expectedContent))
|
||||||
c.Assert(err, checker.IsNil)
|
if test.expectedError {
|
||||||
|
c.Assert(err, checker.NotNil)
|
||||||
|
} else {
|
||||||
|
c.Assert(err, checker.IsNil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue