Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add Accept: */* header" #5

Merged
merged 2 commits into from
Oct 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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