Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the POE-Component-Client-HTTP CPAN distribution.

Report information
The Basics
Id: 13557
Status: resolved
Priority: 0/
Queue: POE-Component-Client-HTTP

Owner: RCAPUTO [...]
Requestors: xantus+cpan [...]

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


Subject: Zero length content header causes request to not post back
Download (untitled) / with headers
text/plain 394b
The test case attached GET's a url with Content-Length: 0 header. Zero length content is unchecked in poco_weeble_io_read. The return at the bottom of the if block near line 464 has the effect of not posting back the response. If checks are added, and that return moved, then line 53 of (return [undef];) causes $input to be undef on the next call to poco_weeble_io_read.
text/x-perl 1.1k
#!/usr/bin/perl # test case for Client::HTTP no content bug use POE qw(Component::Client::HTTP); use HTTP::Request::Common qw(GET); POE::Component::Client::HTTP->spawn( Alias => 'ua' ); POE::Session->create( inline_states => { _start => sub { # get url that has 0 length content $_[KERNEL]->post( 'ua', # posts to the 'ua' alias 'request', # posts to ua's 'request' state 'response', # which of our states will receive the response GET '' ); print "request sent\n"; }, response => sub { my ($request_packet, $response_packet) = @_[ARG0, ARG1]; # HTTP::Request my $request_object = $request_packet->[0]; # HTTP::Response my $response_object = $response_packet->[0]; print( "*" x 78, "\n", "*** my request:\n", "-" x 78, "\n", $request_object->as_string(), "*" x 78, "\n", "*** their response:\n", "-" x 78, "\n", $response_object->as_string(), ); print "*" x 78, "\n"; }, _stop => sub { print "session stopped. You should have recieved a response.\n" }, } ); $poe_kernel->run();
Download (untitled) / with headers
text/plain 202b
I've just committed a fix. Thanks for the test case. I've revised it to use Test::More and point at, and it's now t/50_davis_zerolength.t, so this sort of thing shouldn't happen again. :)

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to