forked from github/szkolny
[API/Vulcan] Fix API url slash issue when migrating from 3.x.
This commit is contained in:
parent
c384736840
commit
39514b69b3
@ -210,11 +210,11 @@ class DataVulcan(app: App, profile: Profile?, loginStore: LoginStore) : Data(app
|
||||
"SZ9" -> "http://hack.szkolny.eu"
|
||||
else -> null
|
||||
}
|
||||
return if (url != null) "$url/$symbol" else loginStore.getLoginData("apiUrl", null)
|
||||
return if (url != null) "$url/$symbol/" else loginStore.getLoginData("apiUrl", null)
|
||||
}
|
||||
|
||||
val fullApiUrl: String?
|
||||
get() {
|
||||
return "$apiUrl/$schoolSymbol"
|
||||
return "$apiUrl$schoolSymbol/"
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ open class VulcanApi(open val data: DataVulcan, open val lastSync: Long?) {
|
||||
baseUrl: Boolean = false,
|
||||
onSuccess: (json: JsonObject, response: Response?) -> Unit
|
||||
) {
|
||||
val url = "${if (baseUrl) data.apiUrl else data.fullApiUrl}/$endpoint"
|
||||
val url = "${if (baseUrl) data.apiUrl else data.fullApiUrl}$endpoint"
|
||||
|
||||
d(tag, "Request: Vulcan/Api - $url")
|
||||
|
||||
|
@ -137,7 +137,7 @@ class VulcanLoginApi(val data: DataVulcan, val onSuccess: () -> Unit) {
|
||||
}
|
||||
|
||||
Request.builder()
|
||||
.url("${data.apiUrl}/$VULCAN_API_ENDPOINT_CERTIFICATE")
|
||||
.url("${data.apiUrl}$VULCAN_API_ENDPOINT_CERTIFICATE")
|
||||
.userAgent(VULCAN_API_USER_AGENT)
|
||||
.addHeader("RequestMobileType", "RegisterDevice")
|
||||
.addParameter("PIN", data.apiPin)
|
||||
|
Loading…
Reference in New Issue
Block a user