Skip to content

Commit 9de4d1c

Browse files
committed
Fixed subdomain check.
1 parent 7f12e16 commit 9de4d1c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.semver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.3
1+
1.7.4

nyawc/helpers/HTTPRequestHelper.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,16 @@ def complies_with_scope(queue_item, new_request, scope):
8585
current_subdomain = URLHelper.get_subdomain(queue_item.request.url)
8686
new_subdomain = URLHelper.get_subdomain(new_request.url)
8787

88-
if current_subdomain != new_subdomain:
89-
if current_subdomain != "www" and new_subdomain != "":
90-
if new_subdomain != "www" and current_subdomain != "":
91-
return False
88+
www_matches = False
89+
90+
if current_subdomain == "www" and new_subdomain == "":
91+
www_matches = True
92+
93+
if new_subdomain == "www" and current_subdomain == "":
94+
www_matches = True
95+
96+
if not www_matches and current_subdomain != new_subdomain:
97+
return False
9298

9399
if scope.hostname_must_match:
94100
if URLHelper.get_hostname(queue_item.request.url) != URLHelper.get_hostname(new_request.url):

0 commit comments

Comments
 (0)