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

Method should_close

gunicorn/asgi/parser.py:919–931  ·  view source on GitHub ↗

Check if connection should be closed after this request.

(self)

Source from the content-addressed store, hash-verified

917 return req
918
919 def should_close(self):
920 """Check if connection should be closed after this request."""
921 if self.must_close:
922 return True
923 for name, value in self.headers:
924 if name == "CONNECTION":
925 v = value.lower().strip(" \t")
926 if v == "close":
927 return True
928 elif v == "keep-alive":
929 return False
930 break
931 return self.version <= (1, 0)
932
933 def get_header(self, name):
934 """Get a header value by name (case-insensitive)."""

Callers 1

_handle_http_requestMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected