[squeak-dev] Unknown cookie field: SameSite
Levente Uzonyi
leves at caesar.elte.hu
Tue Dec 31 17:51:36 UTC 2019
On Tue, 31 Dec 2019, John-Reed Maffeo wrote:
> This message is showing up in Transcript. It originates in #WebCookie readFrom: .
> I tried to add sameSite to the method, but my naive attempt did not work. I also added getter and setter for the new cookie.
>
> It originates from a device called HDHomeRun CONNECT on my local network which I access via HTTP.
>
> There is some information available that describes it.
>
> The incoming text appears to be '__cfduid=de417e50c7d97807e66b4a536a928eade1577808700; expires=Thu, 30-Jan-20 16:11:40 GMT; path=/; domain=.hdhomerun.com; HttpOnly; SameSite=Lax'
>
> 'From Squeak5.2 of 13 December 2018 [latest update: #18229] on 31 December 2019 at 9:18:36 am'!
>
> !WebCookie methodsFor: 'initialize' stamp: 'jrm 12/31/2019 09:18'!
> readFrom: aStream
> "Read a cookie from the given stream"
>
> | keyval key val |
> aStream skipSeparators.
> self halt.
> name := (aStream upTo: $=) withBlanksTrimmed.
> value := (aStream upTo: $;) withBlanksTrimmed.
> [aStream atEnd] whileFalse:[
> keyval := aStream upTo: $;.
> key := (keyval copyUpTo: $=) withBlanksTrimmed.
> val := (keyval copyAfter: $=) withBlanksTrimmed.
> key asLowercase caseOf: {
> ['expires'] -> [self expiry: (self readExpiryFrom: val)].
> ['path'] -> [self path: (WebUtils unquote: val)].
> ['domain'] -> [self domain: (WebUtils unquote: val)].
> ['secure'] -> [self secure: true].
> ['version'] -> [self version: val].
> ['httponly'] -> [self httpOnly: true].
> ['comment'] ->[self comment: val].
> ['max-age'] ->[self expirySeconds: val asNumber].
> ['SameSite'] -> [self sameSite: val].
The above line must contain a lowercase string as the receiver of
#caseOf:otherwise: is a lowercase string.
So, the line should be:
['samesite'] -> [self sameSite: val].
Levente
> } otherwise:[Transcript show: 'Unknown cookie field: ', key].
> ].! !
>
>
> any suggestions?
>
> --
> John-Reed Maffeo
>
>
More information about the Squeak-dev
mailing list
|