summaryrefslogtreecommitdiff
path: root/wsgitools/applications.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/applications.py')
-rw-r--r--wsgitools/applications.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wsgitools/applications.py b/wsgitools/applications.py
index 4ddf7ea..5ef2e8a 100644
--- a/wsgitools/applications.py
+++ b/wsgitools/applications.py
@@ -8,6 +8,9 @@ class StaticContent:
content contains the data to be delivered to the client. It is either a
string or some kind of iterable yielding strings.
"""
+ assert isinstance(status, str)
+ assert isinstance(headers, list)
+ assert hasattr(content, "__iter__")
self.status = status
self.headers = headers
length = -1
@@ -23,6 +26,7 @@ class StaticContent:
headers.append(("Content-length", str(length)))
def __call__(self, environ, start_response):
"""wsgi interface"""
+ assert isinstance(environ, dict)
start_response(self.status, self.headers)
if environ["REQUEST_METHOD"].upper() == "HEAD":
return []