MCPcopy
hub / github.com/benoitc/gunicorn / start_response

Method start_response

gunicorn/http/wsgi.py:318–340  ·  view source on GitHub ↗
(self, status, headers, exc_info=None)

Source from the content-addressed store, hash-verified

316 return True
317
318 def start_response(self, status, headers, exc_info=None):
319 if exc_info:
320 try:
321 if self.status and self.headers_sent:
322 util.reraise(exc_info[0], exc_info[1], exc_info[2])
323 finally:
324 exc_info = None
325 elif self.status is not None:
326 raise AssertionError("Response headers already set!")
327
328 self.status = status
329
330 # get the status code from the response here so we can use it to check
331 # the need for the connection header later without parsing the string
332 # each time.
333 try:
334 self.status_code = int(self.status.split()[0])
335 except ValueError:
336 self.status_code = None
337
338 self.process_headers(headers)
339 self.chunked = self.is_chunked()
340 return self.write
341
342 def process_headers(self, headers):
343 for name, value in headers:

Callers 1

Calls 2

process_headersMethod · 0.95
is_chunkedMethod · 0.95

Tested by 1