Ulrich Wisser <[EMAIL PROTECTED]> writes: > today I got an error code 400 (bad request) from my url checker. When > I tested the url in my browser it worked fine. The url is > > http://www.leomajken.se?source=digdev > > I realize that there is a / missing after the domain name. I don't > know if the problem is in URI or HTTP::Request. URI seems to accept > the URL, but when I try to make an request I get the error code 400. > > Shouldn't that work?
It should. This is an bug in LWP. This is a fix: Index: lib/LWP/Protocol/http.pm =================================================================== RCS file: /cvsroot/libwww-perl/lwp5/lib/LWP/Protocol/http.pm,v retrieving revision 1.66 diff -u -p -r1.66 http.pm --- lib/LWP/Protocol/http.pm 23 Oct 2003 19:11:33 -0000 1.66 +++ lib/LWP/Protocol/http.pm 10 Mar 2004 20:09:36 -0000 @@ -147,7 +147,7 @@ sub request $host = $url->host; $port = $url->port; $fullpath = $url->path_query; - $fullpath = "/" unless length $fullpath; + $fullpath = "/$fullpath" unless $fullpath =~ m,^/,; } # connect to remote site