-
Notifications
You must be signed in to change notification settings - Fork 800
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
Fix additionnal CURLOPT_HTTPHEADER bug #271
base: develop
Are you sure you want to change the base?
Conversation
Put, delete support, overriding of cURL options
When we add additionnal header in the call to the performRequest method like this : $return_api = $this->twitter->buildOauth($url, $requestMethod)->performRequest(true, [ CURLOPT_HTTPHEADER => array('Content-Type:application/json'), CURLOPT_POSTFIELDS => json_encode($postfields) ]); Authentication data is not sent in the request, So we have this type of return : {"errors":[{"code":215,"message":"Bad Authentication data."}]}
@@ -287,6 +287,13 @@ public function performRequest($return = true, $curlOptions = array()) | |||
{ | |||
$curlOptions[CURLOPT_CUSTOMREQUEST] = $this->requestMethod; | |||
} | |||
|
|||
if (isset($curlOptions[CURLOPT_HTTPHEADER])) { |
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.
Minor thing here dude! Coding-standards-wise let's keep some consistency, so {
on new lines and a blank line before the unset
! :) Then, once the code is squashed into 1 commit, I'll merge! Thanks 👍
Once you've done this, if you don't want to do it yourself, I'm going to write a test for the problem that the original user came up with and put it into develop, then merge develop in as 1.07. |
No description provided.