From: Reza Marvan Spagnolo Date: 2012-09-07T08:28:15+09:00 Subject: Re: OpenURI open method problem --f46d042f94a0402f7604c910d804 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable +1 for curl obviously ... sorry was in overkill mode .. :) On Thu, Sep 6, 2012 at 9:30 PM, Brian Candler wrote: > Reza Marvan Spagnolo wrote in post #1074957: > > To assert before which way the redirection actually happens, I'd try > > with a > > browser plugin like Live HTTP Headers or good old Wireshark. > > > > Marvan > > Or good old curl. > > $ curl -v > ' > http://www.anrdoezrs.net/click-5329913-10569016?url=3Dhttp%3A%2F%2Fwww.fa= shion58.com%2Fitemdetail.asp%3Fmod%3DEH5BG213DFSK&cjsku=3DF58-EH5BG213DFSK > ' > * About to connect() to www.anrdoezrs.net port 80 (#0) > * Trying 89.207.18.129... connected > * Connected to www.anrdoezrs.net (89.207.18.129) port 80 (#0) > > GET > /click-5329913-10569016?url=3Dhttp%3A%2F%2Fwww.fashion58.com > %2Fitemdetail.asp%3Fmod%3DEH5BG213DFSK&cjsku=3DF58-EH5BG213DFSK > HTTP/1.1 > > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 > OpenSSL/0.9.8r zlib/1.2.5 > > Host: www.anrdoezrs.net > > Accept: */* > > > < HTTP/1.1 302 Found > < Server: Resin/3.1.8 > < P3P: policyref=3D"http://www.anrdoezrs.net/w3c/p3p.xml", CP=3D"ALL BUS = LEG > DSP COR ADM CUR DEV PSA OUR NAV INT" > < Cache-control: no-store, no-cache, must-revalidate, post-check=3D0, > pre-check=3D0 > < Pragma: no-cache > < Expires: Thu, 06 Sep 2012 19:27:18 GMT > < Location: > > http://www.apmebf.com/sr119hz76P/z5A/ONSTWNOT/SQPWWOQ/N/N/N?w=3Dxdktlv%3D= G69-FI6CH324EGTL%26vsm%3Diuuq%254B%253G%253Gxxx.gbtijpo69.dpn%253Gjufnefubj= m.btq%254Gnpe%254EFI6CH324EGTL > < < Content-Type: text/html > < Cneonction: close > < Transfer-Encoding: chunked > < Date: Thu, 06 Sep 2012 19:27:18 GMT > < > > content=3D" > http://www.apmebf.com/sr119hz76P/z5A/ONSTWNOT/SQPWWOQ/N/N/N?w=3Dxdktlv%3D= G69-FI6CH324EGTL%26vsm%3Diuuq%254B%253G%253Gxxx.gbtijpo69.dpn%253Gjufnefubj= m.btq%254Gnpe%254EFI6CH324EGTL<<iuuq%3A%2F%2Fxxx.bosepf0st.ofu%3A91%2= Fdmjdl-643AA24-2167A127<<H<< > ;"> > The URL has moved href=3D" > http://www.apmebf.com/sr119hz76P/z5A/ONSTWNOT/SQPWWOQ/N/N/N?w=3Dxdktlv%3D= G69-FI6CH324EGTL%26vsm%3Diuuq%254B%253G%253Gxxx.gbtijpo69.dpn%253Gjufnefubj= m.btq%254Gnpe%254EFI6CH324EGTL<<iuuq%3A%2F%2Fxxx.bosepf0st.ofu%3A91%2= Fdmjdl-643AA24-2167A127<<H<< > ;">here > > * Connection #0 to host www.anrdoezrs.net left intact > * Closing connection #0 > > That's a bog-standard 302 redirect. However, curl -Lv shows that there > is a chain of *three* redirects before the final page is reached. > > -- > Posted via http://www.ruby-forum.com/. > > --=20 *Reza Marvan Spagnolo *@ :: marvans@gmail.com m :: + 49 174 9146062 skype :: mrvspg --f46d042f94a0402f7604c910d804 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable +1 for curl obviously ... sorry was in overkill mode .. :)

On Thu, Sep 6, 2012 at 9:30 PM, Brian Candler <list= s@ruby-forum.com> wrote:
Reza Marvan Spagnolo wrote in post #1074957:=
> To assert before which way the redirection actually = happens, I'd try
> with a
> browser plugin like Live HTTP Headers or good old Wireshark.
>
> Marvan

Or good old curl.

$ curl -v
'http://www.anrdoezrs.net/click-53299= 13-10569016?url=3Dhttp%3A%2F%2Fwww.fashion58.com%2Fitemdetail.asp%3Fmod%3DE= H5BG213DFSK&cjsku=3DF58-EH5BG213DFSK'
* About to connect() to www.anrdoezrs.net port 80 (#0)
* =A0 Trying 89.207.18.129... connected
* Connected to www.a= nrdoezrs.net (89.207.18.129) port 80 (#0)
> GET
/click-5329913-10569016?url=3Dhttp%3A%2F%2Fwww.fashion58.com%2Fitemdetail.asp%3Fmod%3DEH5= BG213DFSK&cjsku=3DF58-EH5BG213DFSK
HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: www.anrdo= ezrs.net
> Accept: */*
>
< HTTP/1.1 302 Found
< Server: Resin/3.1.8
< P3P: policyref=3D"http://www.anrdoezrs.net/w3c/p3p.xml", CP=3D&q= uot;ALL BUS LEG
DSP COR ADM CUR DEV PSA OUR NAV INT"
< Cache-control: no-store, no-cache, must-revalidate, post-check=3D0, pre-check=3D0
< Pragma: no-cache
< Expires: Thu, 06 Sep 2012 19:27:18 GMT
< Location:
http://www.apmeb= f.com/sr119hz76P/z5A/ONSTWNOT/SQPWWOQ/N/N/N?w=3Dxdktlv%3DG69-FI6CH324EGTL%2= 6vsm%3Diuuq%254B%253G%253Gxxx.gbtijpo69.dpn%253Gjufnefubjm.btq%254Gnpe%254E= FI6CH324EGTL<<iuuq%3A%2F%2Fxxx.bosepf0st.ofu%3A91%2Fdmjdl-643AA24= -2167A127<<H<<
< Content-Type: text/html
< Cneonction: close
< Transfer-Encoding: chunked
< Date: Thu, 06 Sep 2012 19:27:18 GMT
<
<html>
<head><meta http-equiv=3D"redirect"
content=3D"http://www.apmebf.com/sr119hz76P/z5A/ONSTW= NOT/SQPWWOQ/N/N/N?w=3Dxdktlv%3DG69-FI6CH324EGTL%26vsm%3Diuuq%254B%253G%253G= xxx.gbtijpo69.dpn%253Gjufnefubjm.btq%254Gnpe%254EFI6CH324EGTL&lt;&l= t;iuuq%3A%2F%2Fxxx.bosepf0st.ofu%3A91%2Fdmjdl-643AA24-2167A127&lt;&= lt;H&lt;&lt;"></head>
<body>The URL has moved <a
href=3D"http://www.apmebf.com/sr119hz76P/z5A/ONSTWNOT= /SQPWWOQ/N/N/N?w=3Dxdktlv%3DG69-FI6CH324EGTL%26vsm%3Diuuq%254B%253G%253Gxxx= .gbtijpo69.dpn%253Gjufnefubjm.btq%254Gnpe%254EFI6CH324EGTL&lt;&lt;i= uuq%3A%2F%2Fxxx.bosepf0st.ofu%3A91%2Fdmjdl-643AA24-2167A127&lt;&lt;= H&lt;&lt;">here</a></body></html>

* Connection #0 to host www.anrdoezrs.net left intact
* Closing connection #0

That's a bog-standard 302 redirect. However, curl -Lv shows that there<= br> is a chain of *three* redirects before the final page is reached.



--
= Reza Marvan Spagnolo
@ :: marvans@gmail.com
m :: + 49 174 9146062
skype :: mrvspg

--f46d042f94a0402f7604c910d804--