diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index deeff6cd..7dc86e1c 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -443,7 +443,7 @@ public function register() { 'origin' => $clientData['origin'], ); $registration = $this->tokenGenerator->respondToRegistration($registration, $this->config->getPrivateKey()); - return (new JSONResponse($registration)); + return new JSONResponse($registration, Http::STATUS_CREATED); // ->addHeader('Access-Control-Allow-Origin', $origin) // ->addHeader('Access-Control-Allow-Methods', 'POST'); } diff --git a/solid/tests/Unit/Controller/ServerControllerTest.php b/solid/tests/Unit/Controller/ServerControllerTest.php index a6768aa7..dd83b7c6 100644 --- a/solid/tests/Unit/Controller/ServerControllerTest.php +++ b/solid/tests/Unit/Controller/ServerControllerTest.php @@ -394,7 +394,7 @@ public function testRegisterWithoutRedirectUris() } /** - * @testdox ServerController should return a 200 with client data when asked to register with valid redirect URIs + * @testdox ServerController should return a 201 with client data when asked to register with valid redirect URIs * * @covers ::register */ @@ -421,7 +421,7 @@ public function testRegisterWithRedirectUris() 'response_types' => ['id_token token'], 'token_endpoint_auth_method' => 'client_secret_basic', ]; - $expected = $this->createExpectedResponse(Http::STATUS_OK, $data); + $expected = $this->createExpectedResponse(Http::STATUS_CREATED, $data); $actualData = $response->getData(); $this->assertArrayHasKey('client_id', $actualData);