aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/io
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-01 15:24:43 +0200
committerGitHub <noreply@github.com>2024-04-01 15:24:43 +0200
commit5b994d3f03479c19a5836973ec712442fa4add90 (patch)
treec57f01226ca400dce5c1ba899d353cf579d2ba59 /src/main/kotlin/io
parent83deeb976adb3dbd5aff892368095d27a8dfc29d (diff)
downloadNotEnoughUpdates-5b994d3f03479c19a5836973ec712442fa4add90.tar.gz
NotEnoughUpdates-5b994d3f03479c19a5836973ec712442fa4add90.tar.bz2
NotEnoughUpdates-5b994d3f03479c19a5836973ec712442fa4add90.zip
Add warning when using incorrect NEU api proxy (#1070)
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/util/UrsaClient.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/UrsaClient.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/UrsaClient.kt
index 67df5bf9..4a6bc0e1 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/UrsaClient.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/UrsaClient.kt
@@ -62,6 +62,8 @@ class UrsaClient(val apiUtil: ApiUtil) {
get() = NotEnoughUpdates.INSTANCE.config.apiData.ursaApi.removeSuffix("/").takeIf { it.isNotBlank() }
?: "https://ursa.notenoughupdates.org"
+ fun hasNonStandardUrsa() = ursaRoot != "https://ursa.notenoughupdates.org"
+
private suspend fun authorizeRequest(usedUrsaRoot: String, connection: ApiUtil.Request, t: Token?) {
if (t != null && t.obtainedFrom == usedUrsaRoot) {
logger.log("Authorizing request using token")