* avatar content-type fix
* team default empty values are empty array * page caches only updated if there is actually a filter id set for the team
This commit is contained in:
5
src/App/Handler/AvatarHandler.php
Normal file → Executable file
5
src/App/Handler/AvatarHandler.php
Normal file → Executable file
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\AvatarService;
|
||||
use finfo;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
@@ -36,8 +37,10 @@ class AvatarHandler implements RequestHandlerInterface
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
return new TextResponse("Avatar not found", 404);
|
||||
}
|
||||
$finfo = new finfo(FILEINFO_MIME_TYPE);
|
||||
$contentType = $finfo->buffer($avatarImageData);
|
||||
return (new TextResponse($avatarImageData, 200, [
|
||||
'content-type' => 'image/png',
|
||||
'content-type' => $contentType,
|
||||
]))->withHeader('Expires', '0')
|
||||
->withHeader('Cache-Control', 'must-revalidate');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user