From 072181791551c6fd3cf35d3c599f360a9a04d633 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Tue, 16 Feb 2021 20:37:45 -0300 Subject: [PATCH] check viaversion.github.io in default cors --- src/main/resources/web/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/web/auth.js b/src/main/resources/web/auth.js index ddcff89..9306c06 100644 --- a/src/main/resources/web/auth.js +++ b/src/main/resources/web/auth.js @@ -32,8 +32,11 @@ isNotMojang = it => !it.clientToken; isSuccess = status => status >= 200 && status < 300; // Proxy +function defaultCors() { + return window.location.host == "viaversion.github.io" ? "https://crp123-cors.herokuapp.com/" : "http://localhost:8080/"; +} function getCorsProxy() { - return localStorage.getItem("cors-proxy") || "https://crp123-cors.herokuapp.com/"; + return localStorage.getItem("cors-proxy") || defaultCors(); } function setCorsProxy(url) { localStorage.setItem("cors-proxy", url);