summaryrefslogtreecommitdiff
path: root/waitress/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'waitress/task.py')
-rw-r--r--waitress/task.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/waitress/task.py b/waitress/task.py
index 7136c32..4ce410c 100644
--- a/waitress/task.py
+++ b/waitress/task.py
@@ -358,6 +358,9 @@ class WSGITask(Task):
if not status.__class__ is str:
raise AssertionError('status %s is not a string' % status)
+ if '\n' in status or '\r' in status:
+ raise ValueError("carriage return/line "
+ "feed character present in status")
self.status = status
@@ -371,6 +374,14 @@ class WSGITask(Task):
raise AssertionError(
'Header value %r is not a string in %r' % (v, (k, v))
)
+
+ if '\n' in v or '\r' in v:
+ raise ValueError("carriage return/line "
+ "feed character present in header value")
+ if '\n' in k or '\r' in k:
+ raise ValueError("carriage return/line "
+ "feed character present in header name")
+
kl = k.lower()
if kl == 'content-length':
self.content_length = int(v)