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

Method is_chunked

gunicorn/http/wsgi.py:374–389  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

372 self.headers.append((name, value))
373
374 def is_chunked(self):
375 # Only use chunked responses when the client is
376 # speaking HTTP/1.1 or newer and there was
377 # no Content-Length header set.
378 if self.response_length is not None:
379 return False
380 elif self.req.version <= (1, 0):
381 return False
382 elif self.req.method == 'HEAD':
383 # Responses to a HEAD request MUST NOT contain a response body.
384 return False
385 elif self.status_code in (204, 304):
386 # Do not use chunked responses when the response is guaranteed to
387 # not have a response body.
388 return False
389 return True
390
391 def default_headers(self):
392 # set the connection header

Callers 2

start_responseMethod · 0.95
sendfileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected