From 76dcedcff64bf3710d0384b3a305eb823975b960 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 5 Sep 2024 20:44:08 +0000 Subject: [PATCH] Removed server side pretty printing. --- src/AleisterContentHandler.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/AleisterContentHandler.php b/src/AleisterContentHandler.php index 555b850..93d11d4 100644 --- a/src/AleisterContentHandler.php +++ b/src/AleisterContentHandler.php @@ -14,7 +14,6 @@ class AleisterContentHandler implements IContentHandler { public function hasAcceptableType(): bool { return $this->accept->getMostPreferred([ 'application/json', - 'text/html', // pretty printed JSON ]) !== null; } @@ -49,10 +48,6 @@ class AleisterContentHandler implements IContentHandler { | JSON_PRESERVE_ZERO_FRACTION | JSON_INVALID_UTF8_SUBSTITUTE; - // pretty print if text/html is acceptable, someone is likely poking using a browser - if($this->accept->isAcceptable('text/html')) - $flags |= JSON_PRETTY_PRINT; - $response->setContent(json_encode($content, $flags)); } }