Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add method to capture samesite for cookies and return the cookie #1183

Merged
merged 2 commits into from
Jun 11, 2020

Conversation

jwoertink
Copy link
Member

Purpose

Fixes #1176

Description

Lucky::CookieJar.configure do |settings|
  settings.on_set = ->(cookie : HTTP::Cookie) {
    cookie.secure(Lucky::ForceSSLHandler.settings.enabled)
    cookie.http_only(true)
    cookie.samesite(:strict)
  }
end

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niiicee! Looks good

@paulcsmith
Copy link
Member

Perfect! 🥳

@paulcsmith paulcsmith merged commit 47b4bd6 into master Jun 11, 2020
@paulcsmith paulcsmith deleted the bugs/1176 branch June 11, 2020 17:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no overload matches 'Lucky::CookieJar::Settings.on_set=' with type Proc(HTTP::Cookie, HTTP::Cookie::SameSite)
2 participants