Bug 62369

Summary: req:parseargs returns wrong result
Product: Apache httpd-2 Reporter: Massimiliano Calandrelli <massimiliano.calandrelli>
Component: mod_luaAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Diff file to patch lua_request.c

Description Massimiliano Calandrelli 2018-05-10 17:16:39 UTC
The second table returned by parseargs() should contain a map from a query string argument name to an array filled with its values, but this array always contains just one element, having the last value specified in the query string for that parameter.
This is because lua_request.c uses ap_args_to_table, which in turn uses apr_table_set instead of apr-table-add.

Not being sure if apr_args_to_table is intentionally written that way or if it's just a bug, I patched lua_request.c.

Please note that this patch also includes another one regarding set_output_filter().
Comment 1 Massimiliano Calandrelli 2018-05-10 17:17:30 UTC
Created attachment 35926 [details]
Diff file to patch lua_request.c