Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 40036
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: rajit.b.singh [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: split_header_words converting items to lower-case
Date: Tue, 14 Oct 2008 13:22:25 +0100
To: bug-libwww-perl [...] rt.cpan.org
From: "Rajit Singh" <rajit.b.singh [...] gmail.com>
Hi, In attempting to install Catalyst I found a test of that module failing, t/live_engine_response_cookies.t. That test uses HTTP::Headers::Util::split_header_words to parse part of a response header. The test expected split_header_words to preserve the case of the strings. Due to split_header_words in libwww-perl-5.817 converting part of their return value to lower-case, this test now fails. There was a bug reported, 28713 ( http://rt.cpan.org/Ticket/Display.html?id=28713), asking for split_header_words to honour a case-insensitivity requirement in accordance with the HTTP 1.1 spec, but it was rejected. As such, it appears to be a mistake that this new behaviour has appeared (it did not behave this way in 5.816). If that's correct, it'd be great to revert to the previous behaviour. Cheers.
It seems like I changed my mind based on a review of how I used this function in my own code. The old behaviour is still available as _split_header_words(). I'm willing to restore the old behaviour and have then rename the lower-casing-version of this function if Catalyst has a genuine reason for wanting the case preserved. Do you know what the Catalyst test tries to do?
Subject: Re: [rt.cpan.org #40036] split_header_words converting items to lower-case
Date: Tue, 14 Oct 2008 14:01:21 +0100
To: bug-libwww-perl [...] rt.cpan.org
From: "Rajit Singh" <rajit.b.singh [...] gmail.com>
Actually I'm just a user of Catalyst. If this is the intended behaviour, seems the Catalyst guys should change their test, it certainly is a simple change. I'll post a bug for the Catalyst module and see what they say. On Tue, Oct 14, 2008 at 1:46 PM, Gisle_Aas via RT < bug-libwww-perl@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=40036 > > > It seems like I changed my mind based on a review of how I used this > function in my own code. > The old behaviour is still available as _split_header_words(). > > I'm willing to restore the old behaviour and have then rename the > lower-casing-version of this > function if Catalyst has a genuine reason for wanting the case preserved. > Do you know what > the Catalyst test tries to do? > > >
We were using split_header_words to split up a Set-Cookie string, and we want the case to be preserved. Since split_header_words should probably only be used on HTTP headers, we'll need to use another function I think.
On Tue Oct 14 12:07:04 2008, AGRUNDMA wrote: Show quoted text
> We were using split_header_words to split up a Set-Cookie string, and we > want the case to be preserved. Since split_header_words should probably > only be used on HTTP headers, we'll need to use another function I think.
Parsing Set-Cookie was the only case in LWP itself where I wanted a case-sensitive version of this function. Do you think it's fine for Catalyst to adapt instead of me restoring the old behaviour? You can import the _split_header_words() function (with a leading underscore) to the old function that does not downcase the keys. The patch for this and how I changed HTTP::Cookies is on display at http://gitorious.org/projects/libwww- perl/repos/mainline/commits/dcaeabfdca96e934b8eb3cf49aeccb4ea5a16bcb
OK, we worked around the issue in our test. We need to find a better solution eventually, but it turns out none of the CGI::* modules parse cookies properly, so we can't use a real cookie parser!
On Wed Oct 15 15:25:06 2008, AGRUNDMA wrote: Show quoted text
> OK, we worked around the issue in our test.
Thanks!