mod_form is an example module that modifies or unsets form data pairs according to rules that are configured.
- mod_request
- IHS 9.0 and above / Apache 2.4.x and above
The module can be built using apxs
like so:
/path/to/bin/apxs -ci src/mod_form.c
FormData unset <name-regex>
unsets all form pairs that match the regexname-regex
.FormData edit <name> <pattern> <substitution>
replaces the value of the form pairname
with the value ofsubstitution
if the value matches the regex provided inpattern
.
LoadModule request_module modules/mod_request.so
LoadModule form_module modules/mod_form.so
<Location />
KeptBodySize 2048
FormData unset unset_.*
</Location>
LoadModule request_module modules/mod_request.so
LoadModule form_module modules/mod_form.so
<Location />
KeptBodySize 2048
FormData edit username ^admin_(.*) $1
</Location>