java - Disable OPTIONS Method Jetty Server -


i have developed web application has set of , post calls. want block jetty webserver options call.

currently in response.

http/1.1 200 ok date: tue, 28 apr 2015 07:41:50 gmt server: apache allow: get,head,post,options cache-control: max-age=0 expires: tue, 28 apr 2015 07:41:50 gmt content-length: 0 connection: close content-type: httpd/unix-directory 

i dont want allow - options method type. can tell me how can disable jetty servers property file? not able find property this.

you can disable specific webapps using technique similar how trace disabled.

see jetty-distribution etc/webdefault.xml

how ...

edit webapp's web-inf/web.xml , add following

  <!-- ==================================================================== -->   <!-- disable options method security constraint                      -->   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->   <security-constraint>     <web-resource-collection>       <web-resource-name>disable options</web-resource-name>       <url-pattern>/</url-pattern>       <http-method>options</http-method>     </web-resource-collection>     <auth-constraint/>   </security-constraint>   <security-constraint>     <web-resource-collection>       <web-resource-name>enable options</web-resource-name>       <url-pattern>/</url-pattern>       <http-method-omission>options</http-method-omission>     </web-resource-collection>   </security-constraint>