Fixed texture URLs.

This commit is contained in:
flash 2023-08-22 23:54:15 +00:00
parent 9687753926
commit 941bfe75f6
2 changed files with 4 additions and 3 deletions

View file

@ -57,7 +57,7 @@ $router->setDefaultErrorHandler(function($response, $request, $code, $text) use
(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $config['rpc_secret'], $config['clients_url']))->register($router);
(new HomeRoutes(new Servers($db), $templating, $authInfo, $config['login_url']))->register($router);
(new ClientsRoutes($templating, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo))->register($router);
(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo))->register($router);
(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $config['skins_base_url']))->register($router);
(new WhitelistRoutes(new Whitelist($db), $csrfp, $authInfo))->register($router);
MojangInterop::registerRoutes($router);

View file

@ -23,7 +23,8 @@ class SkinsRoutes {
private Skins $skins,
private Capes $capes,
private CSRFP $csrfp,
private object $authInfo
private object $authInfo,
private string $baseUrl
) {
if(!is_dir(self::TEXTURES_PATH))
throw new RuntimeException('Textures directory does not exist.');
@ -53,7 +54,7 @@ class SkinsRoutes {
}
public function getRemotePath(string $hash, bool $includeDomain): string {
return ($includeDomain ? 'https://mc.edgii.net' : '') . self::TEXTURES_DIR . '/' . $hash . '.png';
return ($includeDomain ? $this->baseUrl : '') . self::TEXTURES_DIR . '/' . $hash . '.png';
}
public function deleteLocalFileMaybe(string $hash): void {