Closed (fixed)
Project:
Http Client
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Jan 2012 at 00:27 UTC
Updated:
22 Aug 2012 at 14:45 UTC
This is a small change, but it would make a big difference for me:
In includes/HttpClientCurlDelegate.inc, move the curl_setopt_array($ch, $curlopts) line to the end of the method, just before the return statement.
This would allow any options sent to be able to override the default settings set within the method itself.
For example, I had to implement the technique described at http://matthom.com/archive/2008/12/29/php-curl-disable-100-continue-expe..., and it would not work until I moved that line.
The resulting method would look like:
public function curl(HttpClientRequest $request, $curlopts) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Drupal (+http://drupal.org/)');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->method);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $request->url());
curl_setopt($ch, CURLOPT_POSTFIELDS, $request->data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders());
curl_setopt_array($ch, $curlopts);
return $ch;
}
Comments
Comment #1
Hugo Wetterberg commentedFixed in 2.4