cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bug in redirection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 12 Oct 2001 11:02:40 +0200 (MET DST)

On Thu, 11 Oct 2001, T. Bharath wrote:

> I happened to find a bug in redirection when a relative url is in the
> Location header

[cut out, check original post for details]

> The parser when trying to connect to this,searches if this has a protocol
> field and mistakenly takes the url in the payload http%3A//dell4me.com
> From there it doesnot work right

Hm. Are you really using 7.9 here? This looks like a problem we already
fixed.

I tried the same URL, and while I got a problem too, it was not the way you
describe it! (And when I tried a 7.8, I noticed your described problem.)

In my tests, this happens:

1. I get this page:
"http://dellapp.us.dell.com/landingstrip/ls.asp?DGC=DC&DGU=%25m&DGSite=MSN&DGStor=DHS&RURL=Dell4Me&DURL=http%3A//dell4me.com?DGVCode=DC&mc=%25m"

2. It redirects my to a different page:
Location:
http://landingstrip.dell.com/landingstrip/ls.asp?DGC=DC&DGU=%25m&DGSite=MSN&DGStor=DHS&RURL=Dell4Me&DURL=http%3A//dell4me.com?DGVCode=DC&mc=%25m

3. We get that page, and get another redirect:
Location:
LS.asp?DGC=DC&DGU=%25m&DGSite=MSN&DGStor=DHS&RURL=Dell4Me&DURL=http%3A//dell4me.com?DGVCode=DC&mc=%25m&Visits=1

(this looks like the one that gave you problems.)

4. We follow that and get the above URL as well, which returns a BAD
redirect:
Location: http://LS.asp?DGC=DC

This can easily be repeated on demand, if you try to get this page:

http://landingstrip.dell.com/landingstrip/ls.asp?DGC=DC&DGU=%25m&DGSite=MSN&DGStor=DHS&RURL=Dell4Me&DURL=http%3A//LS.asp?DGC=DC&DGU=%25m&DGSite=MSN&DGStor=DHS&RURL=Dell4Me&DURL=http%3A//dell4me.com?DGVCode=DC&mc=%25m&Visits=1

If we try to get that redirect, we end up on:

* gethostbyname_r(2) failed for LS.asp?DGC=DC

That sure looks like a bad server application.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-12