Handle unicode in response properly
This commit is contained in:
parent
6729d98039
commit
5f985c36c0
@ -105,15 +105,21 @@ class GetController
|
||||
};
|
||||
}
|
||||
$pagedCollection = $this->collectionsService->pageAndFilterCollection( $request, $object, $filterFunc );
|
||||
|
||||
return new JsonResponse( $pagedCollection );
|
||||
return $this->makeJsonResponse( $pagedCollection );
|
||||
}
|
||||
$response = new JsonResponse( $object->asArray() );
|
||||
$response = $this->makeJsonResponse( $object->asArray() );
|
||||
if ( $object->hasField( 'type' ) &&
|
||||
$object['type'] === 'Tombstone' ) {
|
||||
$response->setStatusCode( 410 );
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function makeJsonResponse( $obj )
|
||||
{
|
||||
$response = new Response( json_encode( $obj, JSON_UNESCAPED_UNICODE ) );
|
||||
$response->headers->set( 'Content-Type', 'application/json' );
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user