MDL-34290 Allow to have several requests to the same instance of oauth_helper
This commit is contained in:
@@ -2898,6 +2898,13 @@ class curl {
|
||||
unset($this->options['CURLOPT_FILE']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the HTTP Request headers (to prepare for the new request)
|
||||
*/
|
||||
public function resetHeader() {
|
||||
$this->header = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set HTTP Request Header
|
||||
*
|
||||
|
||||
@@ -289,6 +289,9 @@ class oauth_helper {
|
||||
$oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token), $method);
|
||||
$this->setup_oauth_http_header($oauth_params);
|
||||
$content = call_user_func_array(array($this->http, strtolower($method)), array($url, $params, $this->http_options));
|
||||
// reset http header and options to prepare for the next request
|
||||
$this->http->resetHeader();
|
||||
// return request return value
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user