docs: @Override
  	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
  		// try and see if this request is for an HTML page
          HttpServletRequest request = (HttpServletRequest) servletRequest;
  
          String uri = request.getRequestURI();
          final boolean htmlPage = isHtmlPage(uri);
  
          // if this is an HTML page, get the entire contents of the page
          // in a byte-stream
          if (!htmlPage) {
              LOGGER.debug("Not an HTML page for javascript reordering: {}", uri);
              filterChain.doFilter(servletRequest, servletResponse);
              return;
          }
  
          // run through a wrapper response object
          HttpServletResponseWrapperImpl wrapper = new HttpServletResponseWrapperImpl((HttpServletResponse) servletResponse);
          filterChain.doFilter(servletRequest, wrapper);
  
          // check if this is an HTML output
          if (!"text/html".equals(wrapper.getContentType())) {
              LOGGER.debug("Response content not HTML for javascript reordering: {}", uri);
  
              // just write the plain response
              // this is not HTML response
              wrapper.copyToResponse(servletResponse);
              return;
          }
  
          final long startTime = System.currentTimeMillis();
          LOGGER.debug("Javascript reordering candidate found: {}", uri);
  
          writeReorderedHtml(wrapper, servletResponse);
          final long endTime = System.currentTimeMillis();
  
          LOGGER.debug("Reordering javascript for url: {} took: {}ms", uri, (endTime - startTime));
  	}