diff --git a/src/SafeCurl.php b/src/SafeCurl.php index 6d2c0e5..98dae6a 100644 --- a/src/SafeCurl.php +++ b/src/SafeCurl.php @@ -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 @@ -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);