Fix additional type hints. (#9543)

Type hint fixes due to Twisted 21.2.0 adding type hints.
This commit is contained in:
Patrick Cloke 2021-03-09 07:41:32 -05:00 committed by GitHub
parent 075c16b410
commit 7fdc6cefb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 18 deletions

View file

@ -322,7 +322,8 @@ def _cache_period_from_headers(
def _parse_cache_control(headers: Headers) -> Dict[bytes, Optional[bytes]]:
cache_controls = {}
for hdr in headers.getRawHeaders(b"cache-control", []):
cache_control_headers = headers.getRawHeaders(b"cache-control") or []
for hdr in cache_control_headers:
for directive in hdr.split(b","):
splits = [x.strip() for x in directive.split(b"=", 1)]
k = splits[0].lower()