Skip Menu |

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

Report information
The Basics
Id: 95836
Status: new
Priority: 0/
Queue: Test-HTTP-Server

People
Owner: Nobody in particular
Requestors: sjors [...] sjorsgielen.nl
Cc:
AdminCc:

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



Subject: HTTP URL beginning with multiple slashes: function not recognised
If the HTTP URL to Test::HTTP::Server is given as "http://localhost//foo", the request path is seen as "//foo" (which is OK), but sub out_all unmaps it to be to ["", "foo"] which invokes the 'index' function instead of the 'foo' function. It would be better (and conform most usages of HTTP, not sure about the standard) if double slashes at the beginning is ignored. This can be done by changing line 282 "$req =~ s#^/##;" to "$req =~ s#^/##g;". The use-case is when a function accepts a base URL from the outside and builds its own request path on top, i.e. the URL is $base_url."/foo". This works both when the caller adds the last slash as well as when he doesn't. In this case, the code only works if the caller does not add the last slash. A workaround is to use s#/$## so that no double slashes are added. Marking unimportant because the workaround is quite easy. Still hard to debug this, though.