Skip to content

Commit

Permalink
Remove URL fragment when photon-izing an image URL
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury committed Jul 1, 2016
1 parent 71bd8cf commit 3278019
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
return imageUrl;
}

// we have encountered some image urls that incorrectly have a # fragment part, which
// must be removed before removing the query string
int fragmentPos = imageUrl.indexOf("#");
if (fragmentPos > 0) {
imageUrl = imageUrl.substring(0, fragmentPos);
}

// remove existing query string since it may contain params that conflict with the passed ones
imageUrl = UrlUtils.removeQuery(imageUrl);

Expand Down

0 comments on commit 3278019

Please sign in to comment.