| 156 | # Convert our custom HttpResponse object back into the mod_python req. |
| 157 | req.content_type = response['Content-Type'] |
| 158 | for key, value in response.headers.items(): |
| 159 | if key != 'Content-Type': |
| 160 | req.headers_out[key] = value |
| 161 | for c in response.cookies.values(): |
| 162 | req.headers_out.add('Set-Cookie', c.output(header='')) |
| 163 | req.status = response.status_code |
| 164 | try: |
| 165 | for chunk in response: |
| 166 | req.write(chunk) |
| 167 | finally: |
| 168 | response.close() |
| 169 | |
159 | | # Convert our custom HttpResponse object back into the mod_python req. |
160 | | req.content_type = response['Content-Type'] |
161 | | for key, value in response.headers.items(): |
162 | | if key != 'Content-Type': |
163 | | req.headers_out[key] = value |
164 | | for c in response.cookies.values(): |
165 | | req.headers_out.add('Set-Cookie', c.output(header='')) |
166 | | req.status = response.status_code |
167 | | try: |
168 | | for chunk in response: |
169 | | req.write(chunk) |
170 | | finally: |
171 | | response.close() |
172 | | |