Commit 541c2f20 authored by Łukasz Nowak's avatar Łukasz Nowak

Do not die in case of missing header.

parent 3f85e32f
......@@ -62,7 +62,8 @@ def requireHeader(header_dict):
def wrapperRequireHeader(self, *args, **kwargs):
problem_dict = {}
for header, value in header_dict.iteritems():
if not re.match(value, self.REQUEST.getHeader(header)):
send_header = self.REQUEST.getHeader(header)
if send_header is None or not re.match(value, send_header):
problem_dict[header] = 'Header with value %r is required.' % value
if not problem_dict:
return fn(self, *args, **kwargs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment