OPTIONS * HTTP/1.1 is a valid request, but it fails in the resources mapping. Probably as a result of the mapper/resources changes. This special URL should probably not go that far into the mapping process in the first place. 05-Nov-2014 09:04:41.708 SEVERE [http-nio-8083-exec-3] org.apache.coyote.http11.AbstractHttp11Processor.process Error processing request java.lang.IllegalArgumentException: The resource path [*] is not valid at org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:250) at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:212) at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:206) at org.apache.catalina.mapper.Mapper.internalMapWrapper(Mapper.java:999) at org.apache.catalina.mapper.Mapper.internalMap(Mapper.java:817) at org.apache.catalina.mapper.Mapper.map(Mapper.java:685) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:872) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:532) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
Additional note: Tomcat 7 returns a response that looks correct: OPTIONS * HTTP/1.1 Host: localhost HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS Content-Length: 0 Date: Wed, 05 Nov 2014 08:51:16 GMT
Fix in r1636850 for 8.0.16.
REOPENing, as I think there is still more to it. With current trunk: GET * HTTP/1.1 Host: a Expected: Error 400 or error 404 (depends on what is written is the spec, I have not looked there yet). Tomcat 7 returns 404. Actual: Error 500 with a stacktrace java.lang.IllegalArgumentException: The resource path [*] is not valid at org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:251) at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:212) at org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:206) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:716) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:411) GET ? HTTP/1.1 Host: a GET foo HTTP/1.1 Host: a Expected=Actual: Error 400, as expected. Other invalid URLs are rejected early. There is special processing for "*" in CoyoteAdapter.normalize(MB) that allows it to survive.
OPTIONS * means an OPTIONS method applied to the whole server, it is used my mod_cluster to ping. This is a valid request, which should be processed by the default servlet as it is now. For any other methods, the 404 looked decent. Looking at the code, I'm not sure what the best option is, since "*" is really invalid as a file path in the resources, and should continue to be rejected with an exception in validate.
Another possibility (looking at the code) is to deal with * in CoyoteAdpater.postParseRequest before mapping, and only OPTIONS would return a non 404 response.
basically OPTIONS * shouldn't be mapped to anything just answered as it is like the CPING/PONG of AJP. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
r1637839