cubicweb/wsgi/handler.py
changeset 12231 55924e962cd7
parent 11767 432f87a63057
child 12567 26744ad37953
equal deleted inserted replaced
12230:93dc77e9da77 12231:55924e962cd7
    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]