public static void addClickjackingPreventionFilter(ServletContextHandler ctxHandler,
    Configuration conf, String pathSpec) {
    FilterHolder holder = new FilterHolder();
    holder.setName("clickjackingprevention");
    holder.setClassName(ClickjackingPreventionFilter.class.getName());
    holder.setInitParameters(ClickjackingPreventionFilter.getDefaultParameters(conf));
    ctxHandler.addFilter(holder, pathSpec, EnumSet.allOf(DispatcherType.class));
  }
Add constraints to a Jetty Context to disallow undesirable Http methods.
@param ctxHandler         The context to modify
@param allowOptionsMethod if true then OPTIONS method will not be set in constraint mapping
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServerUtil.java