mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +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() {
|
||||
return baseURL;
|
||||
String result = baseURL;
|
||||
if (baseURL.endsWith("/")) {
|
||||
result = baseURL.substring(0, baseURL.length() - 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public RetrofitHolder(OkHttpClient okHttpClient) {
|
||||
|
@ -50,9 +50,7 @@ public class UploadImageUtils {
|
||||
JSONObject responseObject = new JSONObject(uploadMediaResponse.body());
|
||||
String fileName = responseObject.getJSONArray("files").getJSONObject(0).getString("file");
|
||||
String baseURL = mRetrofit.getBaseURL();
|
||||
if (baseURL.endsWith("/")) {
|
||||
baseURL = baseURL.substring(0, baseURL.length() - 1);
|
||||
}
|
||||
|
||||
return baseURL + "/pictrs/image/" + fileName;
|
||||
} else {
|
||||
return "Error: " + uploadMediaResponse.code();
|
||||
|
Loading…
Reference in New Issue
Block a user