Skip to content

fix(throttling-manager): Normalize configured domains the same way as crawled hostnames - #2157

Open
Mantisus wants to merge 8 commits into
apify:masterfrom
Mantisus:normaliz-domains
Open

fix(throttling-manager): Normalize configured domains the same way as crawled hostnames#2157
Mantisus wants to merge 8 commits into
apify:masterfrom
Mantisus:normaliz-domains

Conversation

@Mantisus

Copy link
Copy Markdown
Collaborator

Description

  • Configured domains now go through the same URL parsing and normalization as crawled URLs, so punycode, root-dotted and IPv6 spellings match. An entry the parser cannot read now raises ValueError instead of silently matching nothing.

Issues

Testing

  • Added new unit tests

@Mantisus
Mantisus requested a review from janbuchar August 14, 2026 17:33
@Mantisus Mantisus self-assigned this Aug 14, 2026
@vdusek

vdusek commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

@janbuchar Does #2158 (comment) apply to this PR as well, or can this one be reviewed and merged?

@janbuchar

Copy link
Copy Markdown
Collaborator

Also free to go, also will check later.

@vdusek
vdusek requested review from apify-factory and a balanced review from Copilot August 20, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Normalizes configured throttling domains consistently with crawled hostnames.

Changes:

  • Normalizes punycode, trailing dots, casing, and IPv6 literals.
  • Rejects unreadable domain entries.
  • Adds normalization and validation tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/crawlee/request_loaders/_throttling_request_manager.py Adds domain parsing, normalization, and validation.
tests/unit/test_throttling_request_manager.py Tests normalized matching and invalid input.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/crawlee/request_loaders/_throttling_request_manager.py Outdated
Comment thread src/crawlee/request_loaders/_throttling_request_manager.py Outdated

@vdusek vdusek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ThrottlingRequestManager domain matching misses punycode, trailing dots and IPv6 literals

5 participants