Bug 62689 - "OPTIONS *" brothers common/jk_util.c:jk_servlet_normalize
Summary: "OPTIONS *" brothers common/jk_util.c:jk_servlet_normalize
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: mod_jk (show other bugs)
Version: 1.2.44
Hardware: All All
: P2 trivial (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-07 09:30 UTC by lzsiga@freemail.c3.hu
Modified: 2018-09-10 10:13 UTC (History)
0 users



Attachments
apache-2.0/mod_jk.c patch (436 bytes, patch)
2018-09-07 09:30 UTC, lzsiga@freemail.c3.hu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lzsiga@freemail.c3.hu 2018-09-07 09:30:43 UTC
Created attachment 36136 [details]
apache-2.0/mod_jk.c patch

In the latest 'mod_jk' version (1.2.44) new function 'common/jk_utilversion.jk_servlet_normalize ' rejects "*" (from "OPTIONS *") as invalid resource, as it doesn't start with a /slash:

[emerg] jk_servlet_normalize::jk_util.c (2188): [*] does not start with '/'.

jk_servlet_normalize is called by apache-2.0/mod_jk.c:jk_translate (line 3799)

I think there should be an exception for this special case; I guess mod_jk should completely ignore "OPTIONS *", something like this:

--- mod_jk.orig.c	2018-08-24 16:42:42.000000000 +0200
+++ mod_jk.c	2018-09-07 11:27:45.637798286 +0200
@@ -3765,6 +3765,7 @@
     rconf->rule_extensions = NULL;
     ap_set_module_config(r->request_config, &jk_module, rconf);
 
+    if (r->method_number==M_OPTIONS && strcmp (r->uri, "*")==0) return DECLINED;
     if (!r->proxyreq) {
         jk_server_conf_t *conf =
             (jk_server_conf_t *) ap_get_module_config(r->server->
Comment 1 Mark Thomas 2018-09-07 09:50:12 UTC
It should be possible to pass an OPTIONS request to the back-end. jk_servlet_normalize needs to allow it as a special case.
Comment 2 Mark Thomas 2018-09-10 10:13:56 UTC
Thanks for the report and the patch.

It prompted some useful additional review / clean-up and a slightly different solution was adopted.

The fix will be included in 1.2.45 onwards which - given this regression - should be fairly soon.