As stated in RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1
"For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI."
RFC2119:"
SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course."
"SHOULD" is recommendation. Which sometimes does not describe real world situations.
I saw URI.parse used for checking redirects which fails on:
Location: index.php?str=Wrong username or password.
I'm not suppling any fix. It's my third day on ruby, i'm a bit afraid to mess things up.
I used php pear HTTPClient library and Curl who behave right in this particular situation.
Thanks.