Re: HTTP_Client, HTTP_Request or Net_Url problem

From: Date: Tue, 16 May 2006 17:35:59 +0000
Subject: Re: HTTP_Client, HTTP_Request or Net_Url problem
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42515@lists.php.net to get a copy of this message
Hi Markus, Markus Fischer wrote: > Hi, > > we've found a case were HTTP_Client causes a bad request in apache: > > 1) Sent HTTP_Client to e.g. http://server/url/ > 2) http://server/url/ has actually a redirect (Location:) to > "http://server/otherurl?var=has space" > 3) Apache responds with a bad request > > Usual Browser clients recognize the space and encode it, this doesn't > happen with HTTP_Client. > > Now, HTTP_Client internally uses HTTP_Request which recognizes the > Location: and takes the URL "as is" and create a new Net_Url from it (in > HTTP_Request::sendRequest() ). Net_Url, as it seems, doesn't do anything > special with the url, it just sets it to its own property 'this->url' > and that's it. > > To have our application work we had to apply urlencode() before we sent > the Location: over the wire. > > Now, this is likely possible that this violates the spec, but in this > case other Agents can handle this pretty good, so maybe this can done > with the PEAR components too? > > - Markus Try to see if the other agents actually don't fix the space themselves before calling the server back, so we'd know better where the bug occurs. Once you determine that, please log a bug to the appropriate package. Anyway, spaces are not allowed in URLs, just have to figure out at which level that ought to be tolerated and fixed. -Philippe

« previous php.pear.dev (#42515) next »