mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-15 06:09:58 +08:00
Merge branch 'master' of https://github.com/printempw/blessing-skin-server
This commit is contained in:
commit
eaed7ba3d9
5
get.php
5
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 {
|
||||
|
@ -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.');
|
||||
|
Loading…
Reference in New Issue
Block a user