Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
πŸ› Don't parse body if rate limited reached
Browse files Browse the repository at this point in the history
Closes #48
  • Loading branch information
hansott committed Feb 27, 2020
1 parent 513e0ef commit c8072ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pinterest/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(Request $request, $statusCode, $rawBody, array $head
$this->request = $request;
$this->statusCode = (int) $statusCode;
$this->rawBody = (string) $rawBody;
$this->body = $this->parseJson($this->rawBody);
$this->body = $this->statusCode >= 200 && $this->statusCode < 300 ? $this->parseJson($this->rawBody) : null;
$this->headers = $headers;
}

Expand Down

0 comments on commit c8072ed

Please sign in to comment.