PDA

View Full Version : FYI: AsyncHTTP header format change



andyg
2006-05-05, 18:13
If you happen to be using AsyncHTTP's headers in a plugin, note that
for 6.3 and 6.5, the headers are now stored in an HTTP::Headers
object instead of a plain hash. This is to allow for multiple
headers of the same name, such as Set-Cookie.

GoCubs
2006-05-07, 08:36
If you happen to be using AsyncHTTP's headers in a plugin, note that
for 6.3 and 6.5, the headers are now stored in an HTTP::Headers
object instead of a plain hash. This is to allow for multiple
headers of the same name, such as Set-Cookie.

Ahhh... I just upgraded to a new 6.5 nightly and my Sirius plugin wasn't getting its cookie anymore and was wondering what had happened.

Could you provide an example on how to get at the set cookie header using the new object? Also, is there a way to code a plugin so that it'll function regardless of server version?

Thanks
-Greg

andyg
2006-05-07, 08:55
On May 7, 2006, at 11:36 AM, GoCubs wrote:

>
> andyg Wrote:
>> If you happen to be using AsyncHTTP's headers in a plugin, note that
>> for 6.3 and 6.5, the headers are now stored in an HTTP::Headers
>> object instead of a plain hash. This is to allow for multiple
>> headers of the same name, such as Set-Cookie.
>
> Ahhh... I just upgraded to a new 6.5 nightly and my Sirius plugin
> wasn't getting its cookie anymore and was wondering what had happened.
>
> Could you provide an example on how to get at the set cookie header
> using the new object? Also, is there a way to code a plugin so that
> it'll function regardless of server version?

You want to get the cookies in list context, so that HTTP::Headers
will return all values if there is more than 1 cookie:

my @cookies = $http->headers->header('Set-Cookie');

Sorry to break your plugin, but this change needed to be made because
the old way of handling headers was buggy.