Skip to content

Commit d314d8f

Browse files
author
InventisPMTest
committed
- Only use JSON_FORCE_OBJECT when parameters are empty (fixes issue where adding labels to issues fails).
1 parent 8eafe2e commit d314d8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Github/HttpClient/HttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function request($path, array $parameters = array(), $httpMethod = 'GET',
168168
$request = $this->createRequest($httpMethod, $path);
169169
$request->addHeaders($headers);
170170
if (count($parameters) > 0) {
171-
$request->setContent(json_encode($parameters, JSON_FORCE_OBJECT));
171+
$request->setContent(json_encode($parameters, empty($parameters)? JSON_FORCE_OBJECT : 0));
172172
}
173173

174174
$hasListeners = 0 < count($this->listeners);

0 commit comments

Comments
 (0)