}
try {
Configuration configuration = PebbleContext.getInstance().getConfiguration();
if(configuration.getSecureUrl().startsWith("https")) {
UrlRewriter.useThisRewriter(new HttpsURLRewriter(request.getScheme()));
}
chain.doFilter(request, response);
} finally {
UrlRewriter.clear();