]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
RequestHandler.get_argument should raise an HTTP 400 Bad Request if the argument... 253/head
authorMichele Cella <michele.cella@gmail.com>
Thu, 28 Apr 2011 10:49:03 +0000 (03:49 -0700)
committerMichele Cella <michele.cella@gmail.com>
Thu, 28 Apr 2011 10:49:03 +0000 (03:49 -0700)
tornado/web.py

index e32f03bf1dac4617f433f5fb63920fb7a28eb08a..755ccd0a4410e8f46064534e8ecd31e9c80124a0 100644 (file)
@@ -220,7 +220,7 @@ class RequestHandler(object):
         """Returns the value of the argument with the given name.
 
         If default is not provided, the argument is considered to be
-        required, and we throw an HTTP 404 exception if it is missing.
+        required, and we throw an HTTP 400 exception if it is missing.
 
         If the argument appears in the url more than once, we return the
         last value.
@@ -230,7 +230,7 @@ class RequestHandler(object):
         args = self.get_arguments(name, strip=strip)
         if not args:
             if default is self._ARG_DEFAULT:
-                raise HTTPError(404, "Missing argument %s" % name)
+                raise HTTPError(400, "Missing argument %s" % name)
             return default
         return args[-1]