Исправлено поведение hasJoined операции для legacy протокола

This commit is contained in:
ErickSkrauch 2017-02-13 13:44:14 +03:00
parent 014380c82b
commit d262e577a6
2 changed files with 4 additions and 7 deletions

View File

@ -89,15 +89,12 @@ class SessionController extends ApiController {
$hasJoinedForm = new HasJoinedForm($protocol); $hasJoinedForm = new HasJoinedForm($protocol);
try { try {
$hasJoinedForm->hasJoined(); $hasJoinedForm->hasJoined();
} catch (ForbiddenOperationException $e) {
return 'NO';
} catch (SessionServerException $e) { } catch (SessionServerException $e) {
Yii::$app->response->statusCode = $e->statusCode; Yii::$app->response->statusCode = $e->statusCode;
if ($e instanceof ForbiddenOperationException) {
$message = 'NO';
} else {
$message = $e->getMessage();
}
return $message; return $e->getMessage();
} }
return 'YES'; return 'YES';

View File

@ -44,7 +44,7 @@ class HasJoinedLegacyCest {
'user' => 'random-username', 'user' => 'random-username',
'serverId' => Uuid::uuid(), 'serverId' => Uuid::uuid(),
]); ]);
$I->seeResponseCodeIs(401); $I->seeResponseCodeIs(200);
$I->canSeeResponseEquals('NO'); $I->canSeeResponseEquals('NO');
} }