Method
conditional_headers
(self, request: PreparedRequest)
Source from the content-addressed store, hash-verified
| 277 | return False |
| 278 | |
| 279 | def conditional_headers(self, request: PreparedRequest) -> dict[str, str]: |
| 280 | resp = self._load_from_cache(request) |
| 281 | new_headers = {} |
| 282 | |
| 283 | if resp: |
| 284 | headers: CaseInsensitiveDict[str] = CaseInsensitiveDict(resp.headers) |
| 285 | |
| 286 | if "etag" in headers: |
| 287 | new_headers["If-None-Match"] = headers["ETag"] |
| 288 | |
| 289 | if "last-modified" in headers: |
| 290 | new_headers["If-Modified-Since"] = headers["Last-Modified"] |
| 291 | |
| 292 | return new_headers |
| 293 | |
| 294 | def _cache_set( |
| 295 | self, |
Tested by
no test coverage detected