mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 04:37:25 +01:00
Fix bug with inserting malformed image links
This commit is contained in:
parent
0e31e40ef1
commit
495a1d025f
@ -49,7 +49,11 @@ public class UploadImageUtils {
|
||||
if (uploadMediaResponse.isSuccessful()) {
|
||||
JSONObject responseObject = new JSONObject(uploadMediaResponse.body());
|
||||
String fileName = responseObject.getJSONArray("files").getJSONObject(0).getString("file");
|
||||
return mRetrofit.getBaseURL() + "/pictrs/image/" + fileName;
|
||||
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