Browse Source

don't change POST to GET when following redirects

main 0.1.12
Aaron Parecki 2 years ago
parent
commit
cf9c5b7cdb
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      src/p3k/HTTP/Curl.php

+ 1
- 0
src/p3k/HTTP/Curl.php View File

@ -77,6 +77,7 @@ class Curl implements Transport {
curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HEADER, true);
if($this->_max_redirects > 0) if($this->_max_redirects > 0)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTREDIR, 7); // don't change POST to GET on HTTP 301/302/303 redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, $this->_max_redirects); curl_setopt($ch, CURLOPT_MAXREDIRS, $this->_max_redirects);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, round($this->_timeout * 1000)); curl_setopt($ch, CURLOPT_TIMEOUT_MS, round($this->_timeout * 1000));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 2000); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 2000);

Loading…
Cancel
Save