MCPcopy Create free account
hub / github.com/psf/cachecontrol / warning

Method warning

cachecontrol/heuristics.py:28–37  ·  view source on GitHub ↗

Return a valid 1xx warning header value describing the cache adjustments. The response is provided too allow warnings like 113 http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need to explicitly say response is over 24 hours old.

(self, response: HTTPResponse)

Source from the content-addressed store, hash-verified

26
27class BaseHeuristic:
28 def warning(self, response: HTTPResponse) -> str | None:
29 """
30 Return a valid 1xx warning header value describing the cache
31 adjustments.
32
33 The response is provided too allow warnings like 113
34 http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need
35 to explicitly say response is over 24 hours old.
36 """
37 return '110 - "Response is Stale"'
38
39 def update_headers(self, response: HTTPResponse) -> dict[str, str]:
40 """Update the response headers with any new headers.

Callers 1

applyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected