Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/schaal/ocreader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schaal <daniel@schaal.email>2021-07-25 06:59:27 +0300
committerDaniel Schaal <daniel@schaal.email>2021-07-25 10:11:16 +0300
commit89977f496396a337adf6595bb2806c344ec50e9c (patch)
tree777b2d0150e958392148b0d305923f9b4af02b03
parentc73b706ffe1d58f332fd77e62af8890d538a06ad (diff)
Remove trailing slash from API_ROOT
-rw-r--r--app/src/main/java/email/schaal/ocreader/api/API.kt4
-rw-r--r--app/src/test/java/email/schaal/ocreader/APITest.kt2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/email/schaal/ocreader/api/API.kt b/app/src/main/java/email/schaal/ocreader/api/API.kt
index d27fe692..a11075ca 100644
--- a/app/src/main/java/email/schaal/ocreader/api/API.kt
+++ b/app/src/main/java/email/schaal/ocreader/api/API.kt
@@ -49,7 +49,7 @@ class API {
private const val TAG = "API"
const val BATCH_SIZE = 100L
- const val API_ROOT = "index.php/apps/news/api/"
+ const val API_ROOT = "index.php/apps/news/api"
val MIN_VERSION: Version = Version.forIntegers(8, 8, 2)
@@ -143,7 +143,7 @@ class API {
private fun setupApi(httpManager: HttpManager): APIv12Interface {
val retrofit = Retrofit.Builder()
- .baseUrl(httpManager.credentials.rootUrl.buildBaseUrl("$API_ROOT${Level.V12.level}/"))
+ .baseUrl(httpManager.credentials.rootUrl.buildBaseUrl("${API_ROOT}/${Level.V12.level}/"))
.client(httpManager.client)
.addConverterFactory(converterFactory)
.build()
diff --git a/app/src/test/java/email/schaal/ocreader/APITest.kt b/app/src/test/java/email/schaal/ocreader/APITest.kt
index ce872696..894faa6d 100644
--- a/app/src/test/java/email/schaal/ocreader/APITest.kt
+++ b/app/src/test/java/email/schaal/ocreader/APITest.kt
@@ -42,7 +42,7 @@ class APITest {
"https://test.example.com/" to "https://test.example.com/index.php/apps/news/api/v1-2/",
"https://test.example.com/subdir" to "https://test.example.com/subdir/index.php/apps/news/api/v1-2/",
"https://test.example.com/subdir/" to "https://test.example.com/subdir/index.php/apps/news/api/v1-2/")) {
- Assert.assertEquals(url.key.toHttpUrlOrNull()!!.buildBaseUrl("$API_ROOT${Level.V12.level}/").toString(), url.value)
+ Assert.assertEquals(url.key.toHttpUrlOrNull()!!.buildBaseUrl("${API_ROOT}/${Level.V12.level}/").toString(), url.value)
}
}
} \ No newline at end of file