Skip to content

Commit

Permalink
Merge pull request #5 from j0k3r/revert-4-patch-1
Browse files Browse the repository at this point in the history
Revert "Add Accept: */* header"
  • Loading branch information
j0k3r authored Oct 17, 2018
2 parents fdf0b47 + 0c8fd4f commit 71bdb1a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/SafeCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ public function execute($url)
//Validate the URL
$url = Url::validateUrl($url, $this->getOptions());

$headers = array('Accept: */*');
if ($this->getOptions()->getPinDns()) {
//Send a Host header
$headers[] = 'Host: ' . $url['host'];
curl_setopt($this->curlHandle, CURLOPT_HTTPHEADER, array('Host: ' . $url['host']));
//The "fake" URL
curl_setopt($this->curlHandle, CURLOPT_URL, $url['url']);
//We also have to disable SSL cert verfication, which is not great
Expand All @@ -111,7 +110,6 @@ public function execute($url)
} else {
curl_setopt($this->curlHandle, CURLOPT_URL, $url['url']);
}
curl_setopt($this->curlHandle, CURLOPT_HTTPHEADER, $headers);

// in case of `CURLINFO_REDIRECT_URL` isn't defined
curl_setopt($this->curlHandle, CURLOPT_HEADER, true);
Expand Down

0 comments on commit 71bdb1a

Please sign in to comment.