Removed server side pretty printing.
This commit is contained in:
parent
0848b6e708
commit
76dcedcff6
1 changed files with 0 additions and 5 deletions
|
@ -14,7 +14,6 @@ class AleisterContentHandler implements IContentHandler {
|
||||||
public function hasAcceptableType(): bool {
|
public function hasAcceptableType(): bool {
|
||||||
return $this->accept->getMostPreferred([
|
return $this->accept->getMostPreferred([
|
||||||
'application/json',
|
'application/json',
|
||||||
'text/html', // pretty printed JSON
|
|
||||||
]) !== null;
|
]) !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +48,6 @@ class AleisterContentHandler implements IContentHandler {
|
||||||
| JSON_PRESERVE_ZERO_FRACTION
|
| JSON_PRESERVE_ZERO_FRACTION
|
||||||
| JSON_INVALID_UTF8_SUBSTITUTE;
|
| 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));
|
$response->setContent(json_encode($content, $flags));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue