Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: HTTP crawler puts proxy credentials into the URL unencoded

Đã đóng Phù hợp với người mới
#2,326 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@omarbounawarapy đang làm issue này rồi.

Từ ngày 1/10/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, networking, security

Hướng nghiên cứu

Bắt đầu trong async_crawler_strategy.py tại _format_proxy_url quanh dòng 2634, sau đó lần theo việc sử dụng nó làm đối số proxy quanh dòng 2737. Tái hiện các trường hợp ký tự đặc biệt được liệt kê bằng aiohttp và bổ sung kiểm thử hồi quy tập trung. Công việc được xem là hoàn tất khi các yêu cầu proxy hợp lệ giữ nguyên thông tin xác thực theo đúng nghĩa đen và các lỗi không để lộ mật khẩu trong URL lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

⚙ Done 🐞 Bug 🥸 - Medium
crawl4ai version

0.9.4 (same code on develop at 1f68e5b)

Expected Behavior

AsyncHTTPCrawlerStrategy works through a proxy whose username or password contains #, /, ? or %, as the browser path already does (it passes username and password to Playwright as separate fields).

Current Behavior

_format_proxy_url (async_crawler_strategy.py:2634) builds f"{protocol}://{username}:{password}@{rest}" without percent-encoding. Results with aiohttp 3.14.3 against a local proxy:

password result
plainpass, p@ss correct credentials sent
p#ss, pa/ss, p?ss aiohttp.InvalidURL, request never sent
p%41ss proxy receives pAss

The InvalidURL message is the whole URL, and the except aiohttp.ClientError branch re-raises it as HTTPCrawlerError(f"HTTP client error: {str(e)}"), so the password ends up in the error text.

Is this reproducible?

Yes

Inputs Causing the Bug

ProxyConfig(server="http://host:port", username="user", password="p#ss") with AsyncHTTPCrawlerStrategy.

Steps to Reproduce

Pass the output of _format_proxy_url as proxy= to aiohttp.ClientSession.get, which is what the crawler does at async_crawler_strategy.py:2737.

Code snippets
from urllib.parse import quote

return f"{protocol}://{quote(username, safe='')}:{quote(password, safe='')}@{rest}"

(both branches). Happy to send it as a PR to develop with a test.

OS

Windows 10

Python version

3.11

Ngôn ngữ chính
Python
Star
85.9k
Fork
8.9k
Merge trung bình
5 ngày 6 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của unclecode/crawl4ai

Tất cả issue của unclecode/crawl4ai

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.