From 274c7f48a3154e01428da6fc0c249dddf81ae7f9 Mon Sep 17 00:00:00 2001 From: ianb Date: Fri, 20 May 2005 15:28:50 +0000 Subject: Make sure status codes are 3 chars --- paste/lint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'paste/lint.py') diff --git a/paste/lint.py b/paste/lint.py index a52a227..9cb06ea 100644 --- a/paste/lint.py +++ b/paste/lint.py @@ -221,7 +221,10 @@ def check_status(status): assert type(status) is StringType, ( "Status must be a string (not %r)" % status) # Implicitly check that we can turn it into an integer: - status_int = int(status.split(None, 1)[0]) + status_code = status.split(None, 1)[0] + assert len(status_code) == 3, ( + "Status codes must be three characters: %r" % status_code) + status_int = int(status_code) assert status_int >= 100, "Status code is invalid: %r" % status_int def check_headers(headers): -- cgit v1.2.1