mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-13 03:37:11 +01:00
Fix some malformed links
This commit is contained in:
parent
495a1d025f
commit
f61c12a30b
@ -24,7 +24,11 @@ public class RetrofitHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getBaseURL() {
|
public String getBaseURL() {
|
||||||
return baseURL;
|
String result = baseURL;
|
||||||
|
if (baseURL.endsWith("/")) {
|
||||||
|
result = baseURL.substring(0, baseURL.length() - 1);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RetrofitHolder(OkHttpClient okHttpClient) {
|
public RetrofitHolder(OkHttpClient okHttpClient) {
|
||||||
|
@ -50,9 +50,7 @@ public class UploadImageUtils {
|
|||||||
JSONObject responseObject = new JSONObject(uploadMediaResponse.body());
|
JSONObject responseObject = new JSONObject(uploadMediaResponse.body());
|
||||||
String fileName = responseObject.getJSONArray("files").getJSONObject(0).getString("file");
|
String fileName = responseObject.getJSONArray("files").getJSONObject(0).getString("file");
|
||||||
String baseURL = mRetrofit.getBaseURL();
|
String baseURL = mRetrofit.getBaseURL();
|
||||||
if (baseURL.endsWith("/")) {
|
|
||||||
baseURL = baseURL.substring(0, baseURL.length() - 1);
|
|
||||||
}
|
|
||||||
return baseURL + "/pictrs/image/" + fileName;
|
return baseURL + "/pictrs/image/" + fileName;
|
||||||
} else {
|
} else {
|
||||||
return "Error: " + uploadMediaResponse.code();
|
return "Error: " + uploadMediaResponse.code();
|
||||||
|
Loading…
Reference in New Issue
Block a user