From fe05a5f6af952f66ec0d68eaa692099ff076c425 Mon Sep 17 00:00:00 2001 From: Amir Keibi Date: Thu, 6 Jun 2019 15:29:07 -0700 Subject: [PATCH 1/4] ensuring the CookieOption struct's fields are exported (#174) --- roundrobin/stickysessions.go | 4 ++-- roundrobin/stickysessions_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roundrobin/stickysessions.go b/roundrobin/stickysessions.go index 57f6f855..ae95f19c 100644 --- a/roundrobin/stickysessions.go +++ b/roundrobin/stickysessions.go @@ -13,8 +13,8 @@ type StickySession struct { // CookieOptions has all the options one would like to set on the affinity cookie type CookieOptions struct { - httpOnly bool - secure bool + HTTPOnly bool + Secure bool } // NewStickySession creates a new StickySession diff --git a/roundrobin/stickysessions_test.go b/roundrobin/stickysessions_test.go index bca51232..2291de5a 100644 --- a/roundrobin/stickysessions_test.go +++ b/roundrobin/stickysessions_test.go @@ -96,7 +96,7 @@ func TestStickCookieWithOptions(t *testing.T) { fwd, err := forward.New() require.NoError(t, err) - options := CookieOptions{httpOnly: true, secure: true} + options := CookieOptions{HttpOnly: true, Secure: true} sticky := NewStickySessionWithOptions("test", options) require.NotNil(t, sticky) From 39fb088fc9777e048a6e0748bfeaddbc3efea084 Mon Sep 17 00:00:00 2001 From: Amir Keibi Date: Thu, 6 Jun 2019 15:36:35 -0700 Subject: [PATCH 2/4] dep ensuring --- Gopkg.lock | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Gopkg.lock b/Gopkg.lock index c21077d1..47b491dd 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -100,6 +100,20 @@ revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" +[[projects]] + branch = "master" + digest = "1:6ce1a3e2f331fad14560af9d2a245208db1a33e93c935cfacfd226a4540b1749" + name = "github.com/vulcand/oxy" + packages = [ + "forward", + "memmetrics", + "roundrobin", + "testutils", + "utils", + ] + pruneopts = "" + revision = "1bcd53a5921f3314dbfa4a12c0510a9271652f28" + [[projects]] digest = "1:324fcdd450f9e98d18ff566762e9aa6490a2baa56d375551488c0f2b95084f0e" name = "github.com/vulcand/predicate" @@ -161,6 +175,11 @@ "github.com/sirupsen/logrus", "github.com/stretchr/testify/assert", "github.com/stretchr/testify/require", + "github.com/vulcand/oxy/forward", + "github.com/vulcand/oxy/memmetrics", + "github.com/vulcand/oxy/roundrobin", + "github.com/vulcand/oxy/testutils", + "github.com/vulcand/oxy/utils", "github.com/vulcand/predicate", "golang.org/x/net/websocket", ] From e52616d3373e5559e5ab9d55409f227e003997ed Mon Sep 17 00:00:00 2001 From: Amir Keibi Date: Thu, 6 Jun 2019 15:43:20 -0700 Subject: [PATCH 3/4] Updating failing test, I should pay more attention --- roundrobin/stickysessions.go | 2 +- roundrobin/stickysessions_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roundrobin/stickysessions.go b/roundrobin/stickysessions.go index ae95f19c..c9013b6b 100644 --- a/roundrobin/stickysessions.go +++ b/roundrobin/stickysessions.go @@ -53,7 +53,7 @@ func (s *StickySession) GetBackend(req *http.Request, servers []*url.URL) (*url. // StickBackend creates and sets the cookie func (s *StickySession) StickBackend(backend *url.URL, w *http.ResponseWriter) { opt := s.options - cookie := &http.Cookie{Name: s.cookieName, Value: backend.String(), Path: "/", HttpOnly: opt.httpOnly, Secure: opt.secure} + cookie := &http.Cookie{Name: s.cookieName, Value: backend.String(), Path: "/", HttpOnly: opt.HTTPOnly, Secure: opt.Secure} http.SetCookie(*w, cookie) } diff --git a/roundrobin/stickysessions_test.go b/roundrobin/stickysessions_test.go index 2291de5a..d1ecd289 100644 --- a/roundrobin/stickysessions_test.go +++ b/roundrobin/stickysessions_test.go @@ -96,7 +96,7 @@ func TestStickCookieWithOptions(t *testing.T) { fwd, err := forward.New() require.NoError(t, err) - options := CookieOptions{HttpOnly: true, Secure: true} + options := CookieOptions{HTTPOnly: true, Secure: true} sticky := NewStickySessionWithOptions("test", options) require.NotNil(t, sticky) From 255ab78b23f48181548af85d05b8340da6f44490 Mon Sep 17 00:00:00 2001 From: Amir Keibi Date: Thu, 6 Jun 2019 15:52:15 -0700 Subject: [PATCH 4/4] dep ensuring has caused problems, reverting. Although this is really strange that dep should do this --- Gopkg.lock | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 47b491dd..c21077d1 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -100,20 +100,6 @@ revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" -[[projects]] - branch = "master" - digest = "1:6ce1a3e2f331fad14560af9d2a245208db1a33e93c935cfacfd226a4540b1749" - name = "github.com/vulcand/oxy" - packages = [ - "forward", - "memmetrics", - "roundrobin", - "testutils", - "utils", - ] - pruneopts = "" - revision = "1bcd53a5921f3314dbfa4a12c0510a9271652f28" - [[projects]] digest = "1:324fcdd450f9e98d18ff566762e9aa6490a2baa56d375551488c0f2b95084f0e" name = "github.com/vulcand/predicate" @@ -175,11 +161,6 @@ "github.com/sirupsen/logrus", "github.com/stretchr/testify/assert", "github.com/stretchr/testify/require", - "github.com/vulcand/oxy/forward", - "github.com/vulcand/oxy/memmetrics", - "github.com/vulcand/oxy/roundrobin", - "github.com/vulcand/oxy/testutils", - "github.com/vulcand/oxy/utils", "github.com/vulcand/predicate", "golang.org/x/net/websocket", ]