Skip to content

Commit

Permalink
Better solution: Fix the url within PhotonUtils. Hattip @nbradbury
Browse files Browse the repository at this point in the history
  • Loading branch information
roundhill committed Nov 9, 2015
1 parent 964a877 commit 311a009
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 311a009

Please sign in to comment.