Skip Menu |
 

This queue is for tickets about the HTTP-Request-AsCGI CPAN distribution.

Report information
The Basics
Id: 15999
Status: resolved
Priority: 0/
Queue: HTTP-Request-AsCGI

People
Owner: Nobody in particular
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

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



Subject: Regex on uninitialized value when CGI fails
Download (untitled) / with headers
text/plain 876b
When the CGI fails to run, and therefore emits no content, there is a warning: Use of uninitialized value in pattern match (m//) at HTTP/Request/AsCGI.pm line 156 because the $message variable is not initialized. The current code: my $message; while ( my $line = $self->stdout->getline ) { $message .= $line; last if $message =~ /\x0d?\x0a\x0d?\x0a$/; } unless ( $message =~ /^HTTP/ ) { $message = "HTTP/1.1 200 OK\x0d\x0a" . $message; } should become something like: my $message; while ( my $line = $self->stdout->getline ) { $message .= $line; last if $message =~ /\x0d?\x0a\x0d?\x0a$/; } unless ( defined $message ) { $message = "HTTP/1.1 500 Internal Server Error\x0d\x0a" } unless ( $message =~ /^HTTP/ ) { $message = "HTTP/1.1 200 OK\x0d\x0a" . $message; }
On Mon Nov 21 08:32:13 2005, CLOTHO wrote: Show quoted text
> When the CGI fails to run, and therefore emits no content, there is a > warning: > > Use of uninitialized value in pattern match (m//) at > HTTP/Request/AsCGI.pm line 156 > > because the $message variable is not initialized. The current code: > > my $message; > while ( my $line = $self->stdout->getline ) { > $message .= $line; > last if $message =~ /\x0d?\x0a\x0d?\x0a$/; > } > > unless ( $message =~ /^HTTP/ ) { > $message = "HTTP/1.1 200 OK\x0d\x0a" . $message; > } > > should become something like: > > my $message; > while ( my $line = $self->stdout->getline ) { > $message .= $line; > last if $message =~ /\x0d?\x0a\x0d?\x0a$/; > } > > unless ( defined $message ) { > $message = "HTTP/1.1 500 Internal Server Error\x0d\x0a" > } > > unless ( $message =~ /^HTTP/ ) { > $message = "HTTP/1.1 200 OK\x0d\x0a" . $message; > }
Thanks for your report, this has been resolved in 0.4 which should soon should be available on a local mirror. -- Christian Hansen


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.