Skip to content

Commit

Permalink
Fixed accepted content type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
quintindunn committed Jun 29, 2024
1 parent 225d4f4 commit 4fec1d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/database/page_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def page_follows_db_rules(crawler_options: BaseCrawlerOptions, page: Page):
if crawler_options.check_content_type:
content_type = headers.get("content-type")
for accepted_content_type in crawler_options.accepted_content_types:
if content_type and accepted_content_type not in content_type:
return False
if content_type and accepted_content_type in content_type:
break
else:
return False

return True
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def load_data():


LIVE = True
INSTANCE_COUNT = 1
INSTANCE_COUNT = 10
instances = []


Expand Down

0 comments on commit 4fec1d9

Please sign in to comment.