Ticket #156: paste-httpexceptions.diff
| File paste-httpexceptions.diff, 1.2 KB (added by damjan, 5 years ago) |
|---|
-
httpexceptions.py
old new 222 222 'server': SERVER_NAME, 223 223 'body': body } 224 224 225 def wsgi_application(self, environ, start_response, exc_info=None): 226 """ 227 This exception as a WSGI application 228 """ 225 def prepare_content(self, environ): 229 226 if self.headers: 230 227 headers = list(self.headers) 231 228 else: … … 245 242 replace_header( 246 243 headers, 'content-type', 247 244 cur_content_type + '; charset=utf8') 245 return headers, content 246 247 def response(self, environ): 248 from paste.wsgiwrappers import WSGIResponse 249 headers, content = self.prepare_content(environ) 250 resp = WSGIResponse(code=self.code, content=content) 251 resp.headers.update(dict(headers)) 252 return resp 253 254 def wsgi_application(self, environ, start_response, exc_info=None): 255 """ 256 This exception as a WSGI application 257 """ 258 headers, content = self.prepare_content(environ) 248 259 start_response('%s %s' % (self.code, self.title), 249 260 headers, 250 261 exc_info)
