Skip to content

Commit

Permalink
fix: integration test with Go v1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatur authored Jul 18, 2023
1 parent 2df5def commit 00048a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion integration/https_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
desc string
hostHeader string
serverName string
expectedError bool
expectedContent string
expectedStatusCode int
}{
Expand All @@ -1161,6 +1162,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
desc: "Spaces after the host header",
hostHeader: "site3.www.snitest.com ",
serverName: "site3.www.snitest.com",
expectedError: true,
expectedContent: "server3",
expectedStatusCode: http.StatusOK,
},
Expand All @@ -1175,6 +1177,7 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
desc: "Spaces after the servername and host header",
hostHeader: "site3.www.snitest.com ",
serverName: "site3.www.snitest.com ",
expectedError: true,
expectedContent: "server3",
expectedStatusCode: http.StatusOK,
},
Expand Down Expand Up @@ -1223,7 +1226,11 @@ func (s *HTTPSSuite) TestWithDomainFronting(c *check.C) {
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))
c.Assert(err, checker.IsNil)
if test.expectedError {
c.Assert(err, checker.NotNil)
} else {
c.Assert(err, checker.IsNil)
}
}
}

Expand Down

0 comments on commit 00048a8

Please sign in to comment.