equal
deleted
inserted
replaced
77 """encapsulates the wsgi response parameters |
77 """encapsulates the wsgi response parameters |
78 (code, headers and body if there is one) |
78 (code, headers and body if there is one) |
79 """ |
79 """ |
80 def __init__(self, code, req, body=None): |
80 def __init__(self, code, req, body=None): |
81 text = STATUS_CODE_TEXT.get(code, 'UNKNOWN STATUS CODE') |
81 text = STATUS_CODE_TEXT.get(code, 'UNKNOWN STATUS CODE') |
82 self.status = '%s %s' % (code, text) |
82 self.status = '%d %s' % (code, text) |
83 self.headers = list(chain(*[zip(repeat(k), v) |
83 self.headers = list(chain(*[zip(repeat(k), v) |
84 for k, v in req.headers_out.getAllRawHeaders()])) |
84 for k, v in req.headers_out.getAllRawHeaders()])) |
85 self.headers = [(str(k), str(v)) for k, v in self.headers] |
85 self.headers = [(str(k), str(v)) for k, v in self.headers] |
86 if body: |
86 if body: |
87 self.body = [body] |
87 self.body = [body] |