logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

patch: support 302 redirects beside 301: msg#00124

Subject: patch: support 302 redirects beside 301
Bye
Gaetano
--- class.soap_transport_http.163.php   Wed Apr 18 19:51:44 2007
+++ class.soap_transport_http.7.php     Thu Apr 19 16:25:26 2007
@@ -942,9 +942,9 @@
                $this->debug('No cURL error, closing cURL');
                curl_close($this->ch);
 
-               // try removing 100, 301, 401 header(s)
+               // try removing 100, 301, 302, 401 header(s)
                $savedata = $data;
-               while (ereg('^HTTP/1.1 100',$data) || ereg('^HTTP/1.1 
301',$data) || ereg('^HTTP/1.1 401',$data)) {
+               while (ereg('^HTTP/1.1 100',$data) || ereg('^HTTP/1.1 
30[12]',$data) || ereg('^HTTP/1.1 401',$data)) {
                        $this->debug("Found HTTP/1.1 header to skip");
                        if ($pos = strpos($data,"\r\n\r\n")) {
                                $data = ltrim(substr($data,$pos));
@@ -1010,8 +1010,8 @@
                $http_reason = count($arr) > 2 ? $arr[2] : '';
 
                // see if we need to resend the request with http digest 
authentication
-               if (isset($this->incoming_headers['location']) && $http_status 
== 301) {
-                       $this->debug("Got 301 $http_reason with Location: " . 
$this->incoming_headers['location']);
+               if (isset($this->incoming_headers['location']) && ($http_status 
== 301 || $http_status == 302)) {
+                       $this->debug("Got $http_status $http_reason with 
Location: " . $this->incoming_headers['location']);
                        $this->setURL($this->incoming_headers['location']);
                        $this->tryagain = true;
                        return false;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nusoap-general mailing list
Nusoap-general@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/nusoap-general
<Prev in Thread] Current Thread [Next in Thread>