Skip Menu |

This queue is for tickets about the Test-WWW-Mechanize-Catalyst CPAN distribution.

Report information
The Basics
Id: 36442
Status: rejected
Priority: 0/
Queue: Test-WWW-Mechanize-Catalyst

People
Owner: Nobody in particular
Requestors: evdb [...] ecclestoad.co.uk
Cc:
AdminCc:

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



Subject: Invalid Content-Encoding headers not gracefully handled
Date: Wed, 4 Jun 2008 17:36:39 +0100
To: bug-test-www-mechanize-catalyst [...] rt.cpan.org
From: "Edmund von der Burg" <evdb [...] ecclestoad.co.uk>
Hello, If a request has a bad Content-Encoding value the HTTP::Response->decoded_content will return undef. This is confusing and unexpected as it causes tests like $mech->content_contains(...) to fail. Granted - the encoding type is wrong - but that should be reported as a different failure. I'd suggest changing the code from: $response->content( $response->decoded_content ); to: if ( my $decoded_content = $response->decoded_content ) { $response->content($decoded_content); } else { diag "no decoded_content - check that your Content-Encoding header is valid"; } It is annoying that Test::WWW::Mechanize does not use decoded_content - perhaps that should be fixed upstream? Cheers, Edmund. To test use: $c->res->content_encoding('duff'); -- evdb@ecclestoad.co.uk - http://ecclestoad.co.uk
On Wed Jun 04 12:37:12 2008, evdb@ecclestoad.co.uk wrote: Show quoted text
> Hello, > > If a request has a bad Content-Encoding value the > HTTP::Response->decoded_content will return undef. This is confusing > and unexpected as it causes tests like $mech->content_contains(...) to > fail. > > Granted - the encoding type is wrong - but that should be reported as > a different failure. > > I'd suggest changing the code from: > > $response->content( $response->decoded_content ); > > to: > > if ( my $decoded_content = $response->decoded_content ) { > $response->content($decoded_content); > } else { > diag "no decoded_content - check that your Content-Encoding header > is valid"; > } > > > It is annoying that Test::WWW::Mechanize does not use decoded_content > - perhaps that should be fixed upstream? > > Cheers, > Edmund. > > > > To test use: $c->res->content_encoding('duff'); > >
Test reproducing the reported condition committed against trunk and passes, closing as rejected. Please resubmit with a failing test attached if the issue persists.