Skip to content

Commit

Permalink
sync: smoother configuration call (fixes #3402) (#3425)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored May 2, 2024
1 parent 628b3e2 commit 55b58e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1504
versionName "0.15.4"
versionCode 1505
versionName "0.15.5"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ interface ApiInterface {
fun checkAiProviders(@Url url: String?): Call<ResponseBody>

@GET
fun getConfiguration(@Header("Authorization") header: String?, @Url url: String?): Call<JsonObject>
fun getConfiguration(@Url url: String?): Call<JsonObject>
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ class Service(private val context: Context) {
couchdbURL = uri.scheme + "://" + url_user + ":" + url_pwd + "@" + uri.host + ":" + if (uri.port == -1) (if (uri.scheme == "http") 80 else 443) else uri.port
}

val header= "Basic " + Base64.encodeToString(("$url_user:$url_pwd").toByteArray(), Base64.NO_WRAP)
retrofitInterface?.getConfiguration(header, getUrl(couchdbURL) + "/configurations/_all_docs?include_docs=true")?.enqueue(object : Callback<JsonObject?> {
retrofitInterface?.getConfiguration("${getUrl(couchdbURL)}/configurations/_all_docs?include_docs=true")?.enqueue(object : Callback<JsonObject?> {
override fun onResponse(call: Call<JsonObject?>, response: Response<JsonObject?>) {
if (response.isSuccessful) {
val jsonObject = response.body()
Expand Down

0 comments on commit 55b58e3

Please sign in to comment.