From feb3524bf9db54e949ff37ab8ec2f2067b45b643 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 15 Jun 2019 08:32:13 +1000 Subject: [PATCH] Use /skins/ instead of /static/skins for web client --- src/Http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Http.c b/src/Http.c index 35b5bea93..d44ec5bb4 100644 --- a/src/Http.c +++ b/src/Http.c @@ -746,9 +746,10 @@ static void Http_WorkerLoop(void) { #ifdef CC_BUILD_WEB /* Access to XMLHttpRequest at 'http://static.classicube.net' from origin 'http://www.classicube.net' has been blocked by CORS policy: */ /* No 'Access-Control-Allow-Origin' header is present on the requested resource. */ -const static String skinServer = String_FromConst("/static/skins/"); +#define SKIN_SERVER "/skins/" #else -const static String skinServer = String_FromConst("http://static.classicube.net/skins/"); +/* Prefer static.classicube.net to avoid a pointless redirect */ +#define SKIN_SERVER "http://static.classicube.net/skins/" #endif void Http_AsyncGetSkin(const String* id, const String* skinName) { @@ -758,7 +759,7 @@ void Http_AsyncGetSkin(const String* id, const String* skinName) { if (Utils_IsUrlPrefix(skinName, 0)) { String_Copy(&url, skinName); } else { - String_AppendString(&url, &skinServer); + String_AppendConst(&url, SKIN_SERVER); String_AppendColorless(&url, skinName); String_AppendConst(&url, ".png"); }