From 4f4a79d25b4a38169b020684c0017f9d12a390f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Wed, 17 Oct 2018 10:17:30 +0200 Subject: [PATCH 1/2] Revert "Add Accept: */* header" --- src/SafeCurl.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SafeCurl.php b/src/SafeCurl.php index 6d2c0e5..5d1510c 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); From 0c8fd4fc571644a2c59c2e2d310a5101238fa183 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 17 Oct 2018 13:30:33 +0200 Subject: [PATCH 2/2] CS --- src/SafeCurl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SafeCurl.php b/src/SafeCurl.php index 5d1510c..98dae6a 100644 --- a/src/SafeCurl.php +++ b/src/SafeCurl.php @@ -101,7 +101,7 @@ public function execute($url) if ($this->getOptions()->getPinDns()) { //Send a Host header - curl_setopt($this->curlHandle, CURLOPT_HTTPHEADER, array('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