Integer expires = rewriterFeatureFactory.getDefault(gadget.getContext().getContainer()).getExpires();
ContentRewriterFeature rewriterFeature =
rewriterFeatureFactory.createRewriteAllFeature(expires == null ? -1 : expires);
String proxyBaseNoGadget = rewriterUris.getProxyBase(gadget.getContext().getContainer());
LinkRewriter cssImportRewriter = new SanitizingProxyingLinkRewriter(gadget.getSpec().getUrl(),
rewriterFeature, proxyBaseNoGadget, "text/css");
LinkRewriter imageRewriter = new SanitizingProxyingLinkRewriter(gadget.getSpec().getUrl(),
rewriterFeature, proxyBaseNoGadget, "image/*");
// Create the set of filters to process in order.
filters = ImmutableList.of(
new BasicElementFilter(allowedTags, allowedAttributes),