public static void addSecurityHeadersFilter(ServletContextHandler ctxHandler, Configuration conf,
    boolean isSecure, String pathSpec) {
    FilterHolder holder = new FilterHolder();
    holder.setName("securityheaders");
    holder.setClassName(SecurityHeadersFilter.class.getName());
    holder.setInitParameters(SecurityHeadersFilter.getDefaultParameters(conf, isSecure));
    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