Skip to content

Commit

Permalink
update go to 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsmedina authored and andrestc committed Oct 8, 2018
1 parent 0872c71 commit 5d26837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,11 +1,11 @@
language: go
sudo: required
go:
- 1.9
- 1.11.1
- tip
env:
global:
- GO_FOR_RELEASE=1.9
- GO_FOR_RELEASE=1.11.1
- IMAGE_NAME=tsuru/planb
matrix:
- GOARCH=amd64
Expand Down
11 changes: 3 additions & 8 deletions reverseproxy/sni_test.go
Expand Up @@ -28,9 +28,10 @@ var (

// TestRoundTripSNI test SNI reverseproxy using example.com domain
func (s *SNI) TestRoundTripSNI(c *check.C) {
var receivedReq *http.Request
ts := httptest.NewTLSServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
receivedReq = req
c.Assert(req.Host, check.Equals, "example.com")
c.Assert(req.Header.Get("X-My-Header"), check.Equals, "myvalue")
c.Assert(req.Header.Get("X-Host"), check.Equals, "")
rw.Header().Set("X-Some-Rsp-Header", "rspvalue")
rw.WriteHeader(200)
rw.Write([]byte("my result"))
Expand Down Expand Up @@ -68,18 +69,12 @@ func (s *SNI) TestRoundTripSNI(c *check.C) {
data, err := ioutil.ReadAll(rsp.Body)
c.Assert(err, check.IsNil)
c.Assert(string(data), check.Equals, "my result")
c.Assert(receivedReq.Host, check.Equals, "example.com")
c.Assert(receivedReq.Header.Get("X-My-Header"), check.Equals, "myvalue")
c.Assert(receivedReq.Header.Get("X-Host"), check.Equals, "")
c.Assert(receivedReq.Header.Get("X-Forwarded-Host"), check.Equals, "")
c.Assert(router.resultHost, check.Equals, "example.com")
}

// TestRoundTripSNIWithoutHostname test SNI reverseproxy using example.com domain without SNI
func (s *SNI) TestRoundTripSNIWithoutHostname(c *check.C) {
var receivedReq *http.Request
ts := httptest.NewTLSServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
receivedReq = req
rw.Header().Set("X-Some-Rsp-Header", "rspvalue")
rw.WriteHeader(200)
rw.Write([]byte("my result"))
Expand Down

0 comments on commit 5d26837

Please sign in to comment.