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
Fixes new proxy code #60
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,6 +140,21 @@ protected function prepare(Message\Request $request, Message\Response $response, | |
curl_setopt($curl, CURLOPT_MAXREDIRS, $this->maxRedirects); | ||
curl_setopt($curl, CURLOPT_FAILONERROR, !$this->ignoreErrors); | ||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verifyPeer); | ||
|
||
if ($proxy = $this->getProxy()) { | ||
// We actually need the port otherwise curl croaks. Had initially | ||
// tried proxy->getHost() and it did not work since it removed the | ||
// port it matched the scheme default. | ||
curl_setopt($curl, CURLOPT_PROXY, $proxy->getHost().':'.$proxy->getPort()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you tried: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, yeah, that would make more sense. Also, I should have done |
||
if ($user = $proxy->getUser()) { | ||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, $user.':'.$proxy->getPassword()); | ||
} else { | ||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, null); | ||
} | ||
} else { | ||
curl_setopt($curl, CURLOPT_PROXY, null); | ||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, null); | ||
} | ||
} | ||
|
||
public function __destruct() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. :)