Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gorilla/sessions
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: nwidger/sessions
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Sep 28, 2018

  1. Set http.Cookie's SameSite field in NewCookie for Go 1.11 or later

    Set the returned http.Cookie's SameSite field to the value of the
    SameSite field in the Options struct passed into NewCookie.  This
    fixes an oversight made in PR #165 which was made to address issue
    
    Add a newCookieFromOptions function which takes a name, value and
    Options struct and returns an http.Cookie.  There are two
    newCookieFromOptions implementations, one for Go 1.11 and later which
    sets SameSite and one for earlier Go versions which does not.
    
    Add new tests TestNewCookieFromOptions and
    TestNewCookieFromOptionsSameSite which ensure that the values passed
    to newCookieFromOptions are properly set in the returned cookie.  The
    test TestNewCookieFromOptionsSameSite only runs if running Go 1.11 and
    later.
    Niels Widger
    Niels Widger committed Sep 28, 2018
    Configuration menu
    Copy the full SHA
    83ccad6 View commit details
    Browse the repository at this point in the history
  2. Don't use t.Run in tests, not supported in earlier Go versions

    This package is meant to work on Go versions going back to Go 1.3,
    which means tests can't use testing.T.Run which doesn't exists in Go
    1.6 and earlier.
    Niels Widger
    Niels Widger committed Sep 28, 2018
    Configuration menu
    Copy the full SHA
    ec3daf3 View commit details
    Browse the repository at this point in the history
Loading