Bug 62369 - req:parseargs returns wrong result
Summary: req:parseargs returns wrong result
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_lua (show other bugs)
Version: 2.4-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-10 17:16 UTC by Massimiliano Calandrelli
Modified: 2018-05-10 17:17 UTC (History)
0 users



Attachments
Diff file to patch lua_request.c (1.94 KB, patch)
2018-05-10 17:17 UTC, Massimiliano Calandrelli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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