diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-04-27 14:37:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 14:37:28 +0200 |
commit | c52a026f55c70bee22036d28dda01eae087e0c7a (patch) | |
tree | fbe17f895f7526629ee9375b39cf0f1d60c5c209 /build/integration/features/bootstrap | |
parent | bf1c875425e7fdf5ffd3c233ddf1f567428b4168 (diff) | |
parent | 83e10b7a736f7cfa9c933d0476b4784a062bb222 (diff) | |
download | nextcloud-server-c52a026f55c70bee22036d28dda01eae087e0c7a.tar.gz nextcloud-server-c52a026f55c70bee22036d28dda01eae087e0c7a.zip |
Merge pull request #26572 from nextcloud/bugfix/noid/throw-401-when-authentication-is-provided-and-invalid
Throw "401 Unauthenticated" when authentication is provided but invalid
Diffstat (limited to 'build/integration/features/bootstrap')
-rw-r--r-- | build/integration/features/bootstrap/RemoteContext.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/build/integration/features/bootstrap/RemoteContext.php b/build/integration/features/bootstrap/RemoteContext.php index 38f3ab76487..69ebad43208 100644 --- a/build/integration/features/bootstrap/RemoteContext.php +++ b/build/integration/features/bootstrap/RemoteContext.php @@ -138,7 +138,13 @@ class RemoteContext implements Context { * @param string $value */ public function hasCapability($key, $value) { - $capabilities = $this->getApiClient()->getCapabilities(); + try { + $capabilities = $this->getApiClient()->getCapabilities(); + } catch (\Exception $e) { + Assert::assertInstanceOf($value, $e); + $this->lastException = $e; + return; + } $current = $capabilities; $parts = explode('.', $key); foreach ($parts as $part) { |