From 25cb75552baaad62b093b0b38156fcb15dca7826 Mon Sep 17 00:00:00 2001 From: Christoph Stoettner Date: Wed, 30 Sep 2020 12:29:54 +0200 Subject: [PATCH] Fix identation --- application/api/ApiMiddleware.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php index f4a71f7c..7f1e7fca 100644 --- a/application/api/ApiMiddleware.php +++ b/application/api/ApiMiddleware.php @@ -102,16 +102,16 @@ class ApiMiddleware if (! $request->hasHeader('Authorization') && !isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION'])) { throw new ApiAuthorizationException('JWT token not provided'); } - + if (empty($this->conf->get('api.secret'))) { throw new ApiAuthorizationException('Token secret must be set in Shaarli\'s administration'); } - if (isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION'])) { - $authorization = $this->container->environment['REDIRECT_HTTP_AUTHORIZATION']; - } else { + if (isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION'])) { + $authorization = $this->container->environment['REDIRECT_HTTP_AUTHORIZATION']; + } else { $authorization = $request->getHeaderLine('Authorization'); - } + } if (! preg_match('/^Bearer (.*)/i', $authorization, $matches)) { throw new ApiAuthorizationException('Invalid JWT header'); -- 2.41.0