From 835ef0ffc17e3a97e550155673fd71b8a09e266b Mon Sep 17 00:00:00 2001 From: shimon Date: Wed, 17 Aug 2022 12:25:47 +0300 Subject: [PATCH] small fix --- app/controllers/api/avatars.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 91316777fc..e9ef7e5eb6 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -57,8 +57,8 @@ $avatarCallback = function (string $type, string $code, int $width, int $height, App::get('/v1/avatars/credit-cards/:code') ->desc('Get Credit Card Icon') ->groups(['api', 'avatars']) - ->label('cache', true) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/credit-card') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -77,8 +77,8 @@ App::get('/v1/avatars/credit-cards/:code') App::get('/v1/avatars/browsers/:code') ->desc('Get Browser Icon') ->groups(['api', 'avatars']) - ->label('cache', true) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/browser') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -97,8 +97,8 @@ App::get('/v1/avatars/browsers/:code') App::get('/v1/avatars/flags/:code') ->desc('Get Country Flag') ->groups(['api', 'avatars']) - ->label('cache', true) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/flag') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -117,8 +117,8 @@ App::get('/v1/avatars/flags/:code') App::get('/v1/avatars/image') ->desc('Get Image from URL') ->groups(['api', 'avatars']) - ->label('cache', true) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/image') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -168,8 +168,8 @@ App::get('/v1/avatars/image') App::get('/v1/avatars/favicon') ->desc('Get Favicon') ->groups(['api', 'avatars']) - ->label('cache', true) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/favicon') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -274,7 +274,7 @@ App::get('/v1/avatars/favicon') $response ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') ->setContentType('image/x-icon') - ->send($data) + ->file($data) ; } @@ -301,6 +301,7 @@ App::get('/v1/avatars/qr') ->desc('Get QR Code') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/qr') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars') @@ -343,6 +344,7 @@ App::get('/v1/avatars/initials') ->desc('Get User Initials') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') + ->label('cache', true) ->label('cache.resource', 'avatar/initials') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'avatars')