MCPcopy
hub / github.com/django/django / _post_process_request

Function _post_process_request

django/views/decorators/http.py:124–131  ·  view source on GitHub ↗
(request, response, res_etag, res_last_modified)

Source from the content-addressed store, hash-verified

122 return response, res_etag, res_last_modified
123
124 def _post_process_request(request, response, res_etag, res_last_modified):
125 # Set relevant headers on the response if they don't already exist
126 # and if the request method is safe.
127 if request.method in ("GET", "HEAD"):
128 if res_last_modified and not response.has_header("Last-Modified"):
129 response.headers["Last-Modified"] = http_date(res_last_modified)
130 if res_etag:
131 response.headers.setdefault("ETag", res_etag)
132
133 if iscoroutinefunction(func):
134

Callers 1

innerFunction · 0.70

Calls 3

http_dateFunction · 0.90
has_headerMethod · 0.80
setdefaultMethod · 0.45

Tested by

no test coverage detected