Skip to content

Commit

Permalink
don't change POST to GET when following redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpk committed Oct 12, 2021
1 parent 24d2828 commit cf9c5b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/p3k/HTTP/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private function _set_curlopts($ch, $url) {
curl_setopt($ch, CURLOPT_HEADER, true);
if($this->_max_redirects > 0)
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_TIMEOUT_MS, round($this->_timeout * 1000));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 2000);
Expand Down

0 comments on commit cf9c5b7

Please sign in to comment.