Skip to content

Commit

Permalink
Do not add prefix of context twice when calculating base Url
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wolf committed Oct 10, 2014
1 parent 2bb6964 commit d0573d3
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/main/java/com/sonyericsson/jenkins/plugins/bfa/PluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
import hudson.security.PermissionGroup;
import hudson.util.CopyOnWriteList;
import net.sf.json.JSONObject;
import hudson.tasks.Mailer;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;

import java.io.IOException;
Expand Down Expand Up @@ -244,18 +242,6 @@ public static String getImageUrl(String size, String name) {
* @return a URL to the image.
*/
public static String getFullImageUrl(String size, String name) {
String url = Mailer.descriptor().getUrl();
if (url != null) {
String contextPath = "";
StaplerRequest currentRequest = Stapler.getCurrentRequest();
if (currentRequest != null) {
contextPath = currentRequest.getContextPath();
}
if (contextPath.startsWith("/")) {
contextPath = contextPath.substring(1);
}
return Hudson.getInstance().getRootUrl() + contextPath + getImageUrl(size, name);
}
return Hudson.getInstance().getRootUrlFromRequest() + getStaticImagesBase()
+ "/" + size + "/" + name;
}
Expand Down

0 comments on commit d0573d3

Please sign in to comment.