Skip Menu |

This queue is for tickets about the HTTP-Server-Simple CPAN distribution.

Report information
The Basics
Id: 17062
Status: resolved
Priority: 0/
Queue: HTTP-Server-Simple

People
Owner: Nobody in particular
Requestors: jose.mico [...] gmail.com
Cc:
AdminCc:

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



Subject: HTTP::Server::Simple and bad requests
Date: Fri, 13 Jan 2006 18:20:51 -0300
To: "Jesse Vincent" <jesse [...] bestpractical.com>
From: José Micó <jose.mico [...] gmail.com>

Message body is not shown because sender requested not to inline it.

Attached file describe a problem of HTTP::Server::Simple when bad requests are received. I cannot provide a fix, as I don't know the right action to take... José
On Fri Jan 13 18:05:48 2006, jose.mico@gmail.com wrote: Show quoted text
> Attached file describe a problem of HTTP::Server::Simple when bad > requests are received. > I cannot provide a fix, as I don't know the right action to take... > > José
I'm not sure this makes any sense, does it? $ perl -e '("", "", "") or print "hey there\n";' hey there why are you assuming that a list with 3 empty string elements would be equivalent to a false condition?
Subject: Re: [rt.cpan.org #17062] HTTP::Server::Simple and bad requests
Date: Sun, 19 Jul 2009 21:36:34 -0300
To: bug-HTTP-Server-Simple [...] rt.cpan.org
From: José Micó <jose.mico [...] gmail.com>
http://brianhammond.com/ via RT wrote: Show quoted text
> On Fri Jan 13 18:05:48 2006, jose.mico@gmail.com wrote: >
That was three and half years ago :-) I dont' remember exactly what was the problem, let's see how good my report was ;-) Show quoted text
> $ perl -e '("", "", "") or print "hey there\n";' > hey there > > why are you assuming that a list with 3 empty string elements would be > equivalent to a false condition? >
Exactly the opposite, seems that I've founded a place where returning ("", "", "") is not evaluated to a false condition as it should be. The problem was subtle, and was triggered because the returned list was evaluated in list context (so was always 3), and the 'or' block was never executed. Note that the following does not output anythig: $ perl -e '@foo = ("", "", "") or print "hey there\n";' Looking into the source, I can see that the buggy: my ( $method, $request_uri, $proto ) = $self->parse_request or do { $self->bad_request } ...was already replaced by the more sane: my ( $method, $request_uri, $proto ) = $self->parse_request; unless ($self->valid_http_method($method) ) { $self->bad_request } So that bug does not exist anymore, and you can safely close the ticket :-) José