Query strings are not being passed along when mod_negotiation combines multiviews with typemap processing. This is a regression compared to the behavior we had on Apache 1.3.x. It is complementary to PR 33112, which fixed a similar problem, but in a different part of the same module. The guilty party is the call to ap_internal_fast_redirect(sub_req, r) in mod_negotiation.c:handle_multi() which discards the previously parsed args and path_info. That info is not regenerated again. I'm including a very naive patch against 2.2.6 and trunk that fixes this. I'm sure there is a better way to fix it, but need more guidance to achieve it in an optimal way. I'm also submitting a new test for the perl-framework test procedure that tests this behavior, to avoid having this regression in next versions. == Reproducing the bug == You can use either use the new test I'm submitting or use the following scenario. Please adjust accordingly to your server setup. I assume the use of php for printing out the query parameters; you could use perl (like my test procedure contribution does) or a shell script too): 1. In a directory, put the three files that I've attached: test.html, test.php, test.var 2. query the server for test.php?q=3 http://localhost/test.php?q=3 ==> you'll see that the query parameters are correctly passed to the script. 3. query the server for test?q=3 http://localhost/test?q=3 ==> in this case, the query parameters have been discarded by mod_negotiation's call to ap_internal_fast_redirect inside handle_multi(). You'll see that my naive solution is to make a backup copy of args and path_info, if they existed, before the call to ap_internal_fast_redirect(), and then restoring them. This effectively solves the bug. I don't know if there's a better way to do this.
Created attachment 20915 [details] Patch against 2.2.6 Typemap handling didn't pass the query string and path_info parameters
Created attachment 20916 [details] Patch against trunk Typemap handling didn't pass the query string and path_info parameters.
Created attachment 20917 [details] New test procedure for perl-framework for testing typemaps and query string parameters DESCRIPTION The following tests checks that query string parameters are being correctly passed-on whenever a resource is selected by means of a type-map. CONTENT This test has been prepared using the svn trunk version of httpd-test and is comprised of: 1. Test htdocs directory: httpd-test/perl-framework/t/htdocs/modules/negotiation/ \ typemap_query_string | - test.html | - test.pl | - test.var 2. Patches to both t/conf/extra.conf.in and t/modules/negotiation.t to include the new test typemaptest.diff INSTALLATION 1. Check out the httpd-test directory svn checkout http://svn.apache.org/repos/asf/httpd/test/trunk/ \ httpd-test 2. Install the htdocs/modules/negotiation/typemap_query_string/ directory and files. tar -xzf typemapqstest.tgz 3. Patch extra.conf.in and negotiation.t to include the new test patch -p0 <typemaptest.diff DESCRIPTION OF THE TEST The test consists in requesting the following resource: http://server/..../typemap_query_string/test?foo If the query string parameter is being passed correctly, test.pl will be called and will return the string QUERY_STRING --> foo RUNNING THE TEST t/TEST modules/negotiation The new test has number #99. Note that this test will fail unless you apply the patch to mod_negotiation which is included in my report.
Created attachment 20962 [details] Query string were not being handled to resources handled by typemaps (2.2.6 patch) When preparing my patch for submission, I a typo which caused a sigsev. Here's the correct patch.
Created attachment 20963 [details] Query string were not being handled to resources handled by typemaps (trunk patch) When preparing my patch for submission, I a typo which caused a sigsev. Here's the correct patch.
Test case added in http://svn.apache.org/viewvc?view=rev&revision=589666 - thanks!
This seems now fixed by fixing PR33112 *** This bug has been marked as a duplicate of bug 33112 ***