diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java index aa02d4c9deea..b69ad501ef4f 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java @@ -88,6 +88,12 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q return imageUrl + query; } + // use wordpress.com as the host if image is on wordpress.com since it supports the same + // query params and, more importantly, can handle images in private blogs + if (imageUrl.contains("wordpress.com")) { + return imageUrl + query; + } + // must use https for https image urls if (UrlUtils.isHttps(imageUrl)) { return "https://i0.wp.com/" + imageUrl.substring(schemePos+3, imageUrl.length()) + query;