check viaversion.github.io in default cors

This commit is contained in:
creeper123123321 2021-02-16 20:37:45 -03:00 committed by GitHub
parent 74ca162408
commit 0721817915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,8 +32,11 @@ isNotMojang = it => !it.clientToken;
isSuccess = status => status >= 200 && status < 300; isSuccess = status => status >= 200 && status < 300;
// Proxy // Proxy
function defaultCors() {
return window.location.host == "viaversion.github.io" ? "https://crp123-cors.herokuapp.com/" : "http://localhost:8080/";
}
function getCorsProxy() { function getCorsProxy() {
return localStorage.getItem("cors-proxy") || "https://crp123-cors.herokuapp.com/"; return localStorage.getItem("cors-proxy") || defaultCors();
} }
function setCorsProxy(url) { function setCorsProxy(url) {
localStorage.setItem("cors-proxy", url); localStorage.setItem("cors-proxy", url);