Skip to content

Commit 69d4769

Browse files
committed
Removed support for 'dataWrapper' feature.
This feature would cause the library to incorrectly parse responses containing a 'data' field.
1 parent ebdee5b commit 69d4769

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Google/Http/REST.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public static function execute(Google_Client $client, Google_Http_Request $req)
4444
return self::decodeHttpResponse($httpRequest);
4545
}
4646

47-
4847
/**
4948
* Decode an HTTP Response.
5049
* @static
@@ -57,7 +56,7 @@ public static function decodeHttpResponse($response)
5756
$code = $response->getResponseHttpCode();
5857
$body = $response->getResponseBody();
5958
$decoded = null;
60-
59+
6160
if ((intVal($code)) >= 300) {
6261
$decoded = json_decode($body, true);
6362
$err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl();
@@ -79,16 +78,14 @@ public static function decodeHttpResponse($response)
7978

8079
throw new Google_Service_Exception($err, $code, null, $errors);
8180
}
82-
81+
8382
// Only attempt to decode the response, if the response code wasn't (204) 'no content'
8483
if ($code != '204') {
8584
$decoded = json_decode($body, true);
8685
if ($decoded === null || $decoded === "") {
8786
throw new Google_Service_Exception("Invalid json in service response: $body");
8887
}
8988

90-
$decoded = isset($decoded['data']) ? $decoded['data'] : $decoded;
91-
9289
if ($response->getExpectedClass()) {
9390
$class = $response->getExpectedClass();
9491
$decoded = new $class($decoded);

0 commit comments

Comments
 (0)