Repository: falconry/falcon

Issue:
Add additional values on get_param_as_bool like ON, OFF
Hello,

How about add to get_param_as_bool values 

TRUE_STRINGS = [ ... , "on" ]
FALSE_STRINGS = [..., "off" ]

This is related to default value in checkbox on Internet Explorer.

Thanx.

Discussion:
codecov-io: ## [Current coverage](https://codecov.io/gh/falconry/falcon/pull/920?src=pr) is 100% (diff: 100%)
> Merging [#920](https://codecov.io/gh/falconry/falcon/pull/920?src=pr) into [master](https://codecov.io/gh/falconry/falcon/branch/master?src=pr) will not change coverage

```diff
@@           master   #920   diff @@
====================================
  Files          31     31          
  Lines        1970   1970          
  Methods         0      0          
  Messages        0      0          
  Branches      320    320          
====================================
  Hits         1970   1970          
  Misses          0      0          
  Partials        0      0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [45b4176...c168cd0](https://codecov.io/gh/falconry/falcon/compare/45b4176111bce9e52282c2922c0d60a3214ef9f0...c168cd0a120297021fc692468d442c40f83d84af?src=pr)

Patch:
diff --git a/falcon/request.py b/falcon/request.py
index 5557fa7..b5fbc68 100644
--- a/falcon/request.py
+++ b/falcon/request.py
@@ -46,8 +46,8 @@ SimpleCookie = http_cookies.SimpleCookie
 DEFAULT_ERROR_LOG_FORMAT = (u'{0:%Y-%m-%d %H:%M:%S} [FALCON] [ERROR]'
                             u' {1} {2}{3} => ')
 
-TRUE_STRINGS = ('true', 'True', 'yes', '1')
-FALSE_STRINGS = ('false', 'False', 'no', '0')
+TRUE_STRINGS = ('true', 'True', 'yes', '1', 'on')
+FALSE_STRINGS = ('false', 'False', 'no', '0', 'off')
 WSGI_CONTENT_HEADERS = ('CONTENT_TYPE', 'CONTENT_LENGTH')
 
 # PERF(kgriffs): Avoid an extra namespace lookup when using these functions
@@ -948,8 +948,8 @@ class Request(object):
 
         The following boolean strings are supported::
 
-            TRUE_STRINGS = ('true', 'True', 'yes', '1')
-            FALSE_STRINGS = ('false', 'False', 'no', '0')
+            TRUE_STRINGS = ('true', 'True', 'yes', '1', 'on')
+            FALSE_STRINGS = ('false', 'False', 'no', '0', 'off')
 
         Args:
             name (str): Parameter name, case-sensitive (e.g., 'detailed').


Test patch:
diff --git a/tests/test_query_params.py b/tests/test_query_params.py
index 0b6a053..3cfe398 100644
--- a/tests/test_query_params.py
+++ b/tests/test_query_params.py
@@ -257,7 +257,8 @@ class _TestQueryParams(testing.TestBase):
 
     def test_boolean(self):
         query_string = ('echo=true&doit=false&bogus=bar&bogus2=foo&'
-                        't1=True&f1=False&t2=yes&f2=no&blank&one=1&zero=0')
+                        't1=True&f1=False&t2=yes&f2=no&blank&one=1&zero=0&'
+                        'checkbox1=on&checkbox2=off')
         self.simulate_request('/', query_string=query_string)
 
         req = self.resource.captured_req
@@ -285,6 +286,9 @@ class _TestQueryParams(testing.TestBase):
         self.assertEqual(req.get_param_as_bool('zero'), False)
         self.assertEqual(req.get_param('blank'), None)
 
+        self.assertEqual(req.get_param_as_bool('checkbox1'), True)
+        self.assertEqual(req.get_param_as_bool('checkbox2'), False)
+
         store = {}
         self.assertEqual(req.get_param_as_bool('echo', store=store), True)
         self.assertEqual(store['echo'], True)