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

Fix additionnal CURLOPT_HTTPHEADER bug #271

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

sadlig
Copy link

@sadlig sadlig commented Aug 16, 2018

No description provided.

J7mbo and others added 4 commits May 8, 2017 14:10
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])) {
Copy link
Owner

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 👍

@J7mbo J7mbo added the fix label Aug 20, 2018
@J7mbo
Copy link
Owner

J7mbo commented Aug 20, 2018

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.

@J7mbo J7mbo mentioned this pull request Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants