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

Method _response_omits_body

gunicorn/asgi/protocol.py:1332–1342  ·  view source on GitHub ↗

Return True when the response MUST NOT have a body (RFC 9110). Applies to HEAD requests and to status codes that semantically carry no body: 1xx informational, 204 No Content, 304 Not Modified.

(method, status)

Source from the content-addressed store, hash-verified

1330
1331 @staticmethod
1332 def _response_omits_body(method, status):
1333 """Return True when the response MUST NOT have a body (RFC 9110).
1334
1335 Applies to HEAD requests and to status codes that semantically carry no body:
1336 1xx informational, 204 No Content, 304 Not Modified.
1337 """
1338 return (
1339 method == "HEAD"
1340 or status in (204, 304)
1341 or 100 <= status < 200
1342 )
1343
1344 @staticmethod
1345 def _response_forbids_content_length(status):

Callers 2

sendMethod · 0.95
_omitsMethod · 0.80

Calls

no outgoing calls

Tested by 1

_omitsMethod · 0.64