Added a switch to disable following redirects in Request_HTTP
authorDan
Wed, 11 Nov 2009 23:48:55 -0500
changeset 1135 56c0abbdad3e
parent 1134 4fdd92da4fe8
child 1136 8c664c96fccd
Added a switch to disable following redirects in Request_HTTP
includes/http.php
--- a/includes/http.php	Wed Nov 11 23:44:10 2009 -0500
+++ b/includes/http.php	Wed Nov 11 23:48:55 2009 -0500
@@ -153,6 +153,13 @@
   var $headers = array();
   
   /**
+   * Follow server-side redirects; defaults to true.
+   * @var bool
+   */
+  
+  var $follow_redirects = true;
+  
+  /**
    * Cached response.
    * @var string, or bool:false if the request hasn't been sent yet
    */
@@ -450,7 +457,7 @@
     }
     // obey redirects
     $i = 0;
-    while ( $i < 20 )
+    while ( $i < 20 && $this->follow_redirects )
     {
       $incoming_headers = $this->get_response_headers_array();
       if ( !$incoming_headers )