Skip to content

Commit

Permalink
fix content type filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Jun 6, 2022
1 parent f81b53d commit aacc08e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion urldownloader/urldownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def fetch_uri(self, uri: str, apply_filter: bool = True) -> str:
resp = requests.get(uri, allow_redirects=True)
# Only concerned with gathering responses of interest
if resp.ok:
if apply_filter and resp.headers.get('Content-Type') in self.content_type_filter:
if apply_filter and any(content_type in resp.headers.get('Content-Type')
for content_type in self.content_type_filter):
return
resp_fh = NamedTemporaryFile(delete=False)
resp_fh.write(resp.content)
Expand Down

0 comments on commit aacc08e

Please sign in to comment.