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

Don't throw exception if access token is in JSON #34

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

tlshaheen
Copy link

If params are passed as JSON (instead of array), check and see if the access token is part of the JSON.

If it is, do not throw the "You need to give parameters as array if you want to give the token within the URI" exception.

For my example, the URL I pass to fetch() has ?access_token=X as part of the URL string. I am passing my $params as a JSON string that also includes access_token.

Without this change, I'm not sure how #6 was passing JSON $params and not having this error be thrown.

If params are passed as JSON (instead of array), check and see if the access token is part of the JSON.

If it is, do not throw the "You need to give parameters as array if you want to give the token within the URI" exception.
Issue adoy#30 doesn't appear to have been merged. 

In addition, the http_parse_headers function here is a better implementation of parsing the headers - it accounts for a number of things that could be different about the headers.
@vendethiel
Copy link

@adoy ? Maybe not the best implementation, but the behavior change is wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants