This rule requires all <form>
elements to have method
attribute with POST
, GET
or DIALOG
value.
By default form
elements without method
attribute are submitted as GET
requests.
In usual applications submit
event listeners are attached to form
elements and event.preventDefault()
is called to avoid form submission.
However in case of failure to prevent default action, form submission as GET
request can leak sensitive end-user information.
Example uses of GET
requests:
- non-secure data
- bookmarking the submission result
- data search query strings
Caution - this rules does not check for formmethod
attribute on form
elements themselves.
This rule forbids the following:
This rule allows the following:
The following values are valid configuration:
- boolean -
true
to enable /false
to disable - object -- An object with the following keys:
allowedMethods
-- An array of allowed formmethod
attribute values, default:['POST', 'GET', 'DIALOG']