URLFragment implements Fragment { String url(String url, TemplateContext context) { if (!isValidURL(url)) { logger.warn(errorCode("INVALID_URL"), "invalid url detected, url={}, location={}", url, location); return "\"\""; } return cdn ? context.cdnManager.url(url) : url; } URLFragment(String expression, TemplateMetaContext context, boolean cdn, String location); @Override void process(StringBuilder builder, TemplateContext context);  }
@Test void dataURL() { String dataImageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4 assertThat(fragment.url(dataImageURL, new TemplateContext(new TestModel(), null))) .isEqualTo(dataImageURL); }