Summary: | OPTIONS * failure | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Remy Maucherat <remm> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.0.x-trunk | ||
Target Milestone: | ---- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Remy Maucherat
2014-11-05 08:47:25 UTC
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 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 |