Fix tests
This commit is contained in:
parent
41b17822a5
commit
806c50bcdb
1 changed files with 10 additions and 6 deletions
|
@ -1017,10 +1017,12 @@ App::post('/v1/projects/:projectId/platforms')
|
|||
/** @var Utopia\Database\Database $dbForConsole */
|
||||
|
||||
// Ensure hostname has proper structure (no port, protocol..)
|
||||
if(!empty($hostname)) {
|
||||
$validator = new Hostname();
|
||||
if (!is_null($hostname) && !$validator->isValid($hostname)) {
|
||||
throw new Exception($validator->getDescription(), 400, Exception::ATTRIBUTE_VALUE_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
$project = $dbForConsole->getDocument('projects', $projectId);
|
||||
|
||||
|
@ -1142,10 +1144,12 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
|
|||
/** @var Utopia\Database\Database $dbForConsole */
|
||||
|
||||
// Ensure hostname has proper structure (no port, protocol..)
|
||||
if(!empty($hostname)) {
|
||||
$validator = new Hostname();
|
||||
if (!is_null($hostname) && !$validator->isValid($hostname)) {
|
||||
throw new Exception($validator->getDescription(), 400, Exception::ATTRIBUTE_VALUE_INVALID);
|
||||
}
|
||||
}
|
||||
|
||||
$project = $dbForConsole->getDocument('projects', $projectId);
|
||||
|
||||
|
|
Loading…
Reference in a new issue