Исправлено поведение 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);
try {
$hasJoinedForm->hasJoined();
} catch (ForbiddenOperationException $e) {
return 'NO';
} catch (SessionServerException $e) {
Yii::$app->response->statusCode = $e->statusCode;
if ($e instanceof ForbiddenOperationException) {
$message = 'NO';
} else {
$message = $e->getMessage();
}
return $message;
return $e->getMessage();
}
return 'YES';

View File

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