mirror of
https://codeberg.org/vlw/stadia-avatar.git
synced 2025-09-13 23:23:40 +02:00
Concatinating friends and messages for bulk processing. Added empty catch() and response.status check on getStadiaAvatar() to ignore all missing avatars. (Default to Stadia avatar) Changing HTTP Response code from 404 to 200 for missing avatars (but a userID was supplied). CORS headers are not set for error pages in NGINX. This oculd be adressed by recompiling NGINX with more_headers.
15 lines
No EOL
350 B
PHP
15 lines
No EOL
350 B
PHP
<?php
|
|
|
|
require "../classes/Message.php";
|
|
require "../classes/Database.php";
|
|
|
|
$user_id = $_GET["userID"] ?? error("400","No userID provided");
|
|
|
|
$db = new StadiaAvatarDB();
|
|
$avatar = $db->get_avatar($user_id);
|
|
|
|
if(!$avatar) {
|
|
error("200","No avatar was found for the supplied userID");
|
|
}
|
|
|
|
echo "{\"status\":\"OK\",\"avatar\":\"${avatar}\"}"; |