Skip to content

Commit e4037c0

Browse files
committed
Return headers when response body is empty
Signed-off-by: Stiliyan Ivanov <[email protected]>
1 parent 21407db commit e4037c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ public static function responseToArray($response)
357357
$contents,
358358
true
359359
);
360+
} else if ($contents = $response->getHeaders()) {
361+
// Looks like when response body is empty the result might be in the headers.
362+
// Good job LinkedIn.
363+
$result = $contents;
360364
}
361365

362366
return $result;

0 commit comments

Comments
 (0)