mod_form is an example module that modifies or unsets form data pairs according to rules that are configured.
Dependencies
- mod_request
- IHS 9.0 and above / Apache 2.4.x and above
Building the module
The module can be built using apxs
like so:
/path/to/bin/apxs -ci src/mod_form.c
Module directives
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
.
Examples
unset_
Unsetting all pairs starting with LoadModule request_module modules/mod_request.so
LoadModule form_module modules/mod_form.so
<Location />
KeptBodySize 2048
FormData unset unset_.*
</Location>
admin_
Editing usernames to remove the prefix LoadModule request_module modules/mod_request.so
LoadModule form_module modules/mod_form.so
<Location />
KeptBodySize 2048
FormData edit username ^admin_(.*) $1
</Location>