X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=application%2Fapi%2FApiMiddleware.php;h=9fb883589d43a61aff1003882d0531ac8fda3979;hb=2883c6d0a71db174ee8df7548178a8fbee486e25;hp=f5b53b01fcc5f5f16c5d477d054c9483d2e142d9;hpb=255b2264a119f4b8cc9fe211c7740906701e15b4;p=github%2Fshaarli%2FShaarli.git diff --git a/application/api/ApiMiddleware.php b/application/api/ApiMiddleware.php index f5b53b01..9fb88358 100644 --- a/application/api/ApiMiddleware.php +++ b/application/api/ApiMiddleware.php @@ -1,6 +1,8 @@ hasHeader('Authorization') + if ( + !$request->hasHeader('Authorization') && !isset($this->container->environment['REDIRECT_HTTP_AUTHORIZATION']) ) { throw new ApiAuthorizationException('JWT token not provided'); @@ -143,6 +146,7 @@ class ApiMiddleware $linkDb = new BookmarkFileService( $conf, $this->container->get('history'), + new FlockMutex(fopen(SHAARLI_MUTEX_FILE, 'r'), 2), true ); $this->container['db'] = $linkDb;