Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions roundrobin/stickysessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion roundrobin/stickysessions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down