We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 76ab3d5 + d44de17 commit 3f0e7dfCopy full SHA for 3f0e7df
lib/Gitlab/HttpClient/Message/Response.php
@@ -12,12 +12,16 @@ class Response extends BaseResponse
12
public function getContent()
13
{
14
$response = parent::getContent();
15
- $content = json_decode($response, true);
16
-
17
- if (JSON_ERROR_NONE !== json_last_error()) {
+ if ($this->getHeader("Content-Type") === "application/json") {
+ $content = json_decode($response, true);
+
18
+ if (JSON_ERROR_NONE !== json_last_error()) {
19
+ return $response;
20
+ }
21
22
+ return $content;
23
+ } else {
24
return $response;
25
}
- return $content;
26
27
0 commit comments