Re: a <sameAs:> DNU from : ZnMessage>>isConnectionClose
Sven Van Caekenberghe <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <[email protected]> |
Hi Liang, Headers in HTTP (as represented/implemented by the ZnHeaders object in Pharo) can be multi-valued. That is, a certain header name (key) can occur more than once. That creates a multi-valued situation. For example, there can be multiple cookies being set. But almost always, there is only one header with a unique name. What you see must be the result of the 'Connection:close' header line being present twice. I would like to understand how that can happen. Do you have any idea ? I am also not sure (I should check) what the spec says. What is special here is that although the header line occurs twice, it has the same/identical value. In any case, it is the first time I hear about this situation. Sven > On 12 Apr 2018, at 11:30, lb <[email protected]> wrote: > > Hi, > my website always receives a sameAs: DNU from : > ZnMessage>>isConnectionClose > | value | > value := self headers at: 'Connection' ifAbsent: [ ^ false ]. > ^ value sameAs: 'close' > > value is an Array like #('close' 'close'). > > I fix like this to avoid receiving DNU message. > isConnectionClose > | value | > value := self headers at: 'Connection' ifAbsent: [ ^ false ]. > value isArray ifTrue: [^ (value at: 1) sameAs: 'close']. > value isString ifTrue: [^ value sameAs: 'close']. > ^false > I can not confirm that fix is correct. > Liang > _______________________________________________ > seaside mailing list > [email protected] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [email protected] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside