Skip to content

[BUGFIX] Empty JSON-Content will be added to request #33

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

Merged
merged 1 commit into from
Mar 12, 2013
Merged

[BUGFIX] Empty JSON-Content will be added to request #33

merged 1 commit into from
Mar 12, 2013

Conversation

andygrunwald
Copy link
Contributor

If you create an POST-Request (e.g. with an forking action) the HTTPClient will be created with a post content "[]".
This can create some problems on requesting path.

At the moment, if you fork a repository with the following code you will get an exception (500 internal server error on github).

$client = new Github\Client();
$client->getHttpClient();
$client->authenticate('User', 'Password', Github\Client::AUTH_HTTP_PASSWORD);
$client->api('repository')->forks()->create('Github-User-To-Fork', 'Github-User-To-Fork');

This is, because the content is set to "[]".
This seems to be a bug at github side. I`ve reported this bug to github api team.
But anyway. To create clean requests, it would be great to set the content to empty, if it is empty.

Solution: Check if the content is empty.

If you create an POST-Request (e.g. with an forking action) the HTTPClient
will be created with a post content "[]".
This can create some problems on requesting path.

Solution: Check if the content is empty.
stloyd added a commit that referenced this pull request Mar 12, 2013
[BUGFIX] Empty JSON-Content will be added to request
@stloyd stloyd merged commit 9fe2848 into KnpLabs:master Mar 12, 2013
@stloyd
Copy link
Contributor

stloyd commented Mar 12, 2013

Good catch! Thanks!

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