Skip to content

Commit

Permalink
Revert "hotfix: check content-type"
Browse files Browse the repository at this point in the history
This reverts commit 4a7b808.
  • Loading branch information
DEMAxx committed Oct 9, 2024
1 parent 4a7b808 commit 8b91b15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Transport/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getStatusCode(): int
*/
public function data(): array
{
if (!isset($this->headers['content-type']) || strpos($this->headers['content-type'], 'application/json') === false) {
if (!isset($this->headers['content-type']) || $this->headers['content-type'] !== 'application/json') {
throw new RuntimeException('Response is not JSON');
}

Expand All @@ -67,7 +67,7 @@ public function data(): array
*/
public function error(): array
{
if (!isset($this->headers['content-type']) || strpos($this->headers['content-type'], 'application/json') === false) {
if (!isset($this->headers['content-type']) || $this->headers['content-type'] !== 'application/json') {
throw new RuntimeException('Response is not JSON');
}

Expand All @@ -83,7 +83,7 @@ public function error(): array
*/
public function json(): array
{
if (!isset($this->headers['content-type']) || strpos($this->headers['content-type'], 'application/json') === false) {
if (!isset($this->headers['content-type']) || $this->headers['content-type'] !== 'application/json') {
throw new RuntimeException('Response is not JSON');
}

Expand Down

0 comments on commit 8b91b15

Please sign in to comment.