prepare('SELECT avatar_data, avatar_mime FROM lemon_avatars WHERE player_id = :id'); $stmt->bindValue(':id', (int) $playerId, PDO::PARAM_INT); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); } catch (PDOException $e) { http_response_code(404); exit; } if (!$row) { http_response_code(404); exit; } header('Content-Type: ' . $row['avatar_mime']); header('X-Content-Type-Options: nosniff'); header('Content-Length: ' . strlen($row['avatar_data'])); header('Content-Disposition: inline'); // Les avatars changent rarement : cache navigateur d'une heure, comme les PDF (voir viewPdf.php) header('Cache-Control: public, max-age=3600'); echo $row['avatar_data']; exit;