* 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:
Dávid Danyi
2018-09-06 16:37:37 +02:00
parent 9563eae0b1
commit 65098ee587
3 changed files with 9 additions and 4 deletions

5
src/App/Handler/AvatarHandler.php Normal file → Executable file
View 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');
}