Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: kane [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.42
Fixed in: 0.50_2



Subject: TWMC doesn't work nice with cookies
I've worked around that changing '_make_request' as follows, but this should probably be integrated in TWMC: ### XXX this needs to be set for Test::WWW::Mech::Cat, as using a ### non-schemed URI makes HTTP::Cookies not add a cookie to the ### header. Setting this var prefixes every path with the hostname ### XXX at least broken in 0.42. Fix is to add to T:W:M:C->_make_request, { my $code = Test::WWW::Mechanize::Catalyst->can( '_make_request' ); no warnings 'redefine'; *Test::WWW::Mechanize::Catalyst::_make_request = sub { my ( $self, $request ) = @_; ### build a new uri, adding the hostname if( not $request->uri->can('host') or $request->uri->host ne 'localhost' ) { ### if there's no leading slash, make sure we add it my $delim = $request->uri->as_string =~ m|^/| ? '' : '/'; $request->uri( URI->new( TEST_HOSTNAME .$delim. $request->uri ) ); } $code->( $self, $request ); } }
Fixed as part of the refactor, and available now on cpan as v0.50