Conversation
| end | ||
| it 'should accept SameSite attribute' do | ||
| cookie = Cookie.from_set_cookie 'http://127.0.0.1/', 'foo=bar;samesite=strict' | ||
| expect(CookieValidation.validate_cookie('http://127.0.0.1/', cookie)).to be_truthy |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [88/80]
| CookieValidation.validate_cookie('http://foo.com/bar/baz/', higher) | ||
| end | ||
| it 'should accept SameSite attribute' do | ||
| cookie = Cookie.from_set_cookie 'http://127.0.0.1/', 'foo=bar;samesite=strict' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [84/80]
| higher = Cookie.from_set_cookie 'http://foo.com/bar/baz/', 'foo=bar;path=/bar/' | ||
| CookieValidation.validate_cookie('http://foo.com/bar/baz/', higher) | ||
| end | ||
| it 'should accept SameSite attribute' do |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
| end | ||
| it 'should accept SameSite attribute' do | ||
| cookie = Cookie.from_set_cookie 'https://www.google.com/a/blah', 'GALX=RgmSftjnbPM;samesite=strict' | ||
| expect(cookie.same_site).to eq 'strict' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
| expect(cookie.secure).to be_truthy | ||
| end | ||
| it 'should accept SameSite attribute' do | ||
| cookie = Cookie.from_set_cookie 'https://www.google.com/a/blah', 'GALX=RgmSftjnbPM;samesite=strict' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [105/80]
| expect(cookie.name).to eq 'GALX' | ||
| expect(cookie.secure).to be_truthy | ||
| end | ||
| it 'should accept SameSite attribute' do |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
The commit adb79c0 has as its message "add support for samesite cookie". It actually only makes the validator recognize the samesite attribute, but does not expose the value via the cookie object and does not add any tests.
This PR adds the same_site attribute (note that the instance variable name was changed to
@same_sitefrom@samesiteto be consistent with http_only/httponly) and adds tests.