#2 Relative redirects

closed
None
5
2003-10-21
2000-12-06
Anonymous
No

I also found that the calculation of relative URI's in location redirects is incorrect - HTTP1.1 states that the URI is relative to the referring URI, not to the host root.
(I'm using Snoopy to connect to a system called efares which has been giving me grief with this minor issue)
Something like this:
$this->_redirectaddr=$URI_PARTS["scheme"]."://".$this->host.":".$this->port;
if (ereg("^\/",$matches[2]))
$this->_redirectaddr.=dirname($url).$matches[2];
else
$this->_redirectaddr.=dirname($url)."/".$matches[2];

Discussion

  • Nobody/Anonymous

    Logged In: NO

    one line before this :
    I changed
    preg_match("/^(Location: |URI:)(.*)/",chop
    ($currentHeader),$matches);

    with
    preg_match("/^(Location: |URI:)[ ]+(.*)/",chop
    ($currentHeader),$matches);

    The bug occures with 0.94 when doing
    ->fetch("http://web.icq.com/whitepages/online");

     
  • Monte Ohrt

    Monte Ohrt - 2002-10-09
    • assigned_to: nobody --> mohrt
     
  • Monte Ohrt

    Monte Ohrt - 2002-10-09

    Logged In: YES
    user_id=10328

    applied this change, although I could not reproduce the
    original problem. try again with recent changes, see if this
    still persists.

     
  • Eric Mueller

    Eric Mueller - 2003-09-01

    Logged In: YES
    user_id=140377

    I believe this is the same bug I'm seeing when I try to retrieve
    http://catalog1.lapl.org/launchers/catalog_english.html

    the problems appears to be in the _expandlinks function, it is
    entered with:

    $links = "http://catalog1.lapl.org/cgi-bin/cw_cgi?
    5005+CONFIGcw_catalog_english.ini+useDatabase_965"

    $URL
    = "http://catalog1.lapl.org/launchers/catalog_english.html"

    it SHOULD be returning $links with no change, but it instead
    returns

    http://catalog1.lapl.org/launchers/cgi-bin/cw_cgi?
    5005+CONFIGcw_catalog_english.ini+useDatabase_965

    which is an invalid URL (404).

    best
    Eric Mueller, eric@themepark.com

     
  • Monte Ohrt

    Monte Ohrt - 2003-10-21

    Logged In: YES
    user_id=10328

    changes added.

     
  • Monte Ohrt

    Monte Ohrt - 2003-10-21
    • status: open --> closed
     
  • Eric Mueller

    Eric Mueller - 2003-10-21

    Logged In: YES
    user_id=140377

    gracias...

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks