Skip to content

Commit 9e24598

Browse files
authored
fix: add port for same-origin strategy check (#1096)
### Description - add port for `same-origin` strategy check
1 parent 805d525 commit 9e24598

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/crawlee/crawlers/_basic/_basic_crawler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,11 @@ def _check_enqueue_strategy(
804804
return origin_domain == target_domain
805805

806806
if strategy == 'same-origin':
807-
return target_url.hostname == origin_url.hostname and target_url.scheme == origin_url.scheme
807+
return (
808+
target_url.hostname == origin_url.hostname
809+
and target_url.scheme == origin_url.scheme
810+
and target_url.port == origin_url.port
811+
)
808812

809813
if strategy == 'all':
810814
return True

0 commit comments

Comments
 (0)