[development] Redirection issue with drupal_http_request
arancaytar.ilyaran at gmail.com
Sat Aug 14 20:44:11 UTC 2010
On 08/14/2010 08:39 PM, nitin gupta wrote:
> I recently came across this issue when drupal_http_request reported error
> (-1002 - missing schema) for the following URL:
> This URL redirects twice. For the first time, it returns the location:
> with 302 code.
> This URL when requested returns the Location:
> with 302 code.
> As the drupal_http_request requests the location, a missing schema error is
> reported. Whereas the browser, and the following test site:
> http://www.rexswain.com/cgi-bin/httpview.cgi, correctly returns the content
> of the page.
> Is drupal_http_request missing some recommended functionality?
> Nitin Kumar Gupta
drupal_http_request is not missing any standard functionality; it
expects the location field to contain an absolute URI and that is what
the standard specifies. However, this is a frequently encountered quirk,
and a workaround might do some good there.
From the HTTP/1.1 RFC:
The Location response-header field is used to redirect the recipient to
a location other than the Request-URI for completion of the request or
identification of a new resource. [...] *The field value consists of a
single absolute URI.*
Location = "Location" ":" absoluteURI
An example is:
XMPP: arancaytar.ilyaran at gmail.com / ICQ: 282026638 / AIM: arancaytar42
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 262 bytes
Desc: OpenPGP digital signature
Url : http://lists.drupal.org/pipermail/development/attachments/20100814/8fed5bab/attachment.bin
More information about the development