mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Merge pull request #684 from zype/cookie-samesite-param
Support SameSite attribute in cookies
This commit is contained in:
commit
90c52e8e60
2 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
class HTTParty::CookieHash < Hash #:nodoc:
|
||||
CLIENT_COOKIES = %w(path expires domain path secure httponly)
|
||||
CLIENT_COOKIES = %w(path expires domain path secure httponly samesite)
|
||||
|
||||
def add_cookies(value)
|
||||
case value
|
||||
|
|
|
@ -79,6 +79,12 @@ RSpec.describe HTTParty::CookieHash do
|
|||
expect(@s).not_to match(/path=\//)
|
||||
end
|
||||
|
||||
it "should not include SameSite attribute" do
|
||||
@cookie_hash.add_cookies(samesite: "Strict")
|
||||
@s = @cookie_hash.to_cookie_string
|
||||
expect(@s).not_to match(/samesite=Strict/)
|
||||
end
|
||||
|
||||
it "should not include client side only cookies even when attributes use camal case" do
|
||||
@cookie_hash.add_cookies(Path: "/")
|
||||
@s = @cookie_hash.to_cookie_string
|
||||
|
|
Loading…
Reference in a new issue