1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
This commit is contained in:
Jon Eisenstein 2020-02-05 13:31:15 -05:00
parent 689e64bb2d
commit 35ba4ba1aa
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,5 @@
class HTTParty::CookieHash < Hash #:nodoc: 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) def add_cookies(value)
case value case value

View file

@ -74,6 +74,12 @@ RSpec.describe HTTParty::CookieHash do
expect(@s).not_to match(/path=\//) expect(@s).not_to match(/path=\//)
end 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 it "should not include client side only cookies even when attributes use camal case" do
@cookie_hash.add_cookies(Path: "/") @cookie_hash.add_cookies(Path: "/")
@s = @cookie_hash.to_cookie_string @s = @cookie_hash.to_cookie_string