Same applies for 307
308 spec mentions 307 must not rewrite POST to GET
This commit is contained in:
parent
cb46f7b227
commit
7f13baf367
@ -172,7 +172,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
|
|||||||
if (isset($url_parsed)) {
|
if (isset($url_parsed)) {
|
||||||
$redirects++;
|
$redirects++;
|
||||||
@curl_close($ch);
|
@curl_close($ch);
|
||||||
if($http_code == 308) {
|
if($http_code == 307 || $http_code == 308) {
|
||||||
return post_url($newurl,$params,$redirects,$timeout);
|
return post_url($newurl,$params,$redirects,$timeout);
|
||||||
} else {
|
} else {
|
||||||
return fetch_url($newurl,false,$redirects,$timeout);
|
return fetch_url($newurl,false,$redirects,$timeout);
|
||||||
@ -355,9 +355,10 @@ function z_post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0
|
|||||||
if (isset($url_parsed)) {
|
if (isset($url_parsed)) {
|
||||||
$redirects++;
|
$redirects++;
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
if($http_code == 308) {
|
if($http_code == 307 || $http_code == 308) {
|
||||||
return z_post_url($newurl,$params,$headers,$redirects,$timeout);
|
return z_post_url($newurl,$params,$headers,$redirects,$timeout);
|
||||||
} else {
|
} else {
|
||||||
|
logger("params=".print_r($params, true));
|
||||||
return z_fetch_url($newurl,false,$headers,$redirects,$timeout);
|
return z_fetch_url($newurl,false,$headers,$redirects,$timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user