Merge pull request #6293 from nextcloud/less-user-enumeration

Return the user id in case of an error
This commit is contained in:
Joas Schilling 2017-08-29 13:25:25 +02:00 committed by GitHub
commit 79a7b7f192
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ class AvatarController extends Controller {
} catch (\Exception $e) {
$resp = new JSONResponse([
'data' => [
'displayname' => '',
'displayname' => $userId,
],
]);
}

View File

@ -169,7 +169,7 @@ class AvatarControllerTest extends \Test\TestCase {
//Comment out until JS is fixed
//$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
$this->assertEquals(Http::STATUS_OK, $response->getStatus());
$this->assertEquals('', $response->getData()['data']['displayname']);
$this->assertEquals('userDoesNotExist', $response->getData()['data']['displayname']);
}
/**