wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/ImageUrlRewriter.java
private String computeCssUriForExternalServer(final String cssUri) {
    String exernalServerCssUri = cssUri;
    try {
      // compute the host of the external server (with protocol & port).
      final String serverHost = cssUri.replace(new URL(cssUri).getPath(), StringUtils.EMPTY);
      // the uri should end mandatory with /
      exernalServerCssUri = serverHost + ServletContextUriLocator.PREFIX;
      LOG.debug("using {} host as cssUri", exernalServerCssUri);
    } catch (final MalformedURLException e) {
      // should never happen
    }
    return exernalServerCssUri;
  }
private String computeCssUriForExternalServer(final String cssUri) {
    String exernalServerCssUri = cssUri;
    try {
      // compute the host of the external server (with protocol & port).
      final String serverHost = cssUri.replace(new URL(cssUri).getPath(), StringUtils.EMPTY);
      // the uri should end mandatory with /
      exernalServerCssUri = serverHost + ServletContextUriLocator.PREFIX;
      LOG.debug("using {} host as cssUri", exernalServerCssUri);
    } catch (final MalformedURLException e) {
      // should never happen
    }
    return exernalServerCssUri;
  }
private String computeCssUriForExternalServer ( final String cssUri ) { String exernalServerCssUri = cssUri ; try { // compute the host of the external server (with protocol & port). final String serverHost = cssUri . replace ( new URL ( cssUri ) . getPath ( ) , StringUtils . EMPTY ) ; // the uri should end mandatory with / exernalServerCssUri = serverHost + ServletContextUriLocator . PREFIX ; LOG . debug ( "using {} host as cssUri" , exernalServerCssUri ) ; } catch ( final MalformedURLException e ) { // should never happen } return exernalServerCssUri ; }
Css files hosted on external server, should use its host as the root context when rewriting image url's starting
with '/' character.
Css files hosted on external server should use its host as the root context when rewriting image url s starting with / character .