diff --git a/get.php b/get.php index f2f7c4ed..bdde6825 100644 --- a/get.php +++ b/get.php @@ -3,7 +3,7 @@ * @Author: prpr * @Date: 2016-02-02 20:56:42 * @Last Modified by: prpr - * @Last Modified time: 2016-02-05 14:51:26 + * @Last Modified time: 2016-02-06 21:51:19 * * All textures requests of legacy link will be handle here. */ @@ -18,7 +18,8 @@ if (isset($_GET['type']) && isset($_GET['uname'])) { $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : null; if ($_GET['type'] == "skin" || $_GET['type'] == "cape") { - $model = (isset($_GET['model']) && $_GET['model'] == "steve") ? "steve" : "alex"; + $model_preferrnce = ($user->getPreference() == "default") ? "steve" : "alex"; + $model = (isset($_GET['model']) && $_GET['model'] == "") ? $model_preferrnce : $_GET['model']; if ($if_modified_since >= $user->getLastModified()) { header('HTTP/1.0 304 Not Modified'); } else { diff --git a/includes/user.class.php b/includes/user.class.php index a25b167d..a4d7b0c8 100644 --- a/includes/user.class.php +++ b/includes/user.class.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-01-16 23:01:33 * @Last Modified by: prpr - * @Last Modified time: 2016-02-05 21:58:57 + * @Last Modified time: 2016-02-06 21:34:21 */ class user @@ -95,6 +95,7 @@ class user header('Content-Type: image/png'); // Cache friendly header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->getLastModified()).' GMT'); + header('Content-Length: '.filesize($filename)); return utils::fread($filename); } else { utils::raise(-1, 'Texture no longer exists.');