[BUG]: Scraper passes headers as query params in requests.get (User-Agent never sent)
評価
調査の方向性
backend/app/modules/scraper/extractor.py の Article_extractor._fetch_html() から始めます。backend/ ディレクトリから提供された uv コマンドを実行して、現在のリクエスト動作を確認します。設定された User-Agent がヘッダーとして送信され、ヘッダーが URL のクエリパラメーターにシリアライズされなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
In backend/app/modules/scraper/extractor.py, Article_extractor._fetch_html() calls:
res = requests.get(self.url, self.headers, timeout=10)
The second positional argument of requests.get(url, params=None, **kwargs) is params, not headers. So:
- The custom
User-Agentheader is never sent. - The headers dict is instead serialized into the URL query string (e.g.
?User-Agent=Mozilla%2F5.0...), producing a malformed request.
_fetch_html() backs extract_with_bs4(), which is the last-resort fallback (it runs only when Trafilatura and Newspaper3k both fail) — so exactly when robust fetching matters most, the request goes out without the intended User-Agent and with a polluted URL.
Steps to Reproduce
Deterministic, no app/keys needed — from the backend/ directory:
uv run python -c "from app.modules.scraper.extractor import Article_extractor; print(Article_extractor('https://httpbin.org/get')._fetch_html())"
Observe the response: the args object contains User-Agent (proving it was sent as a query param), and headers.User-Agent is the default python-requests/... (proving the custom UA was not applied).
Logs and Screenshots
Deterministic, no app/keys needed — from the backend/ directory:
uv run python -c "from app.modules.scraper.extractor import Article_extractor; print(Article_extractor('https://httpbin.org/get')._fetch_html())"
Observe the response: the args object contains User-Agent (proving it was sent as a query param), and headers.User-Agent is the default python-requests/... (proving the custom UA was not applied).
Environment Details
- Present on current
main(commit 70a2af4), independent of OS. - Backend: Python 3.13,
requests>=2.32.3. - Root cause is a universal
requestsAPI behavior, so it reproduces in every environment.
Impact
Medium - Feature works but has issues
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- 主要言語
- TypeScript
- スター
- 58
- フォーク
- 90
- 平均マージ
- 11時間 51分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/Perspective のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
AOSSIE-Org/Perspective#191 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
AOSSIE-Org/Perspective#190 ·
-
[BUG]: Missing input validation in URlRequest and ChatQuery causes 500 crashes and wasteful scraper execution対応中かも @agarwalpranav0711 が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/Perspective#178 ·
-
[BUG]: chunk_rag_data crashes with ValueError when perspective is a dict, silently dropping RAG vector storage対応中かも @agarwalpranav0711 が 36 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AOSSIE-Org/Perspective#175 ·
-
docs: frontend/README.md is the default create-next-app boilerplate対応中かも @Th-Shivam が 51 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
AOSSIE-Org/Perspective#159 · コメント 1 件 ·
AOSSIE-Org/Perspective の issue をすべて見る
似ている issue
-
documentation lens:human needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
thebristolsound/birdbrain#2246 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug ready-for-human
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
BoardGamesEmpire/board-games-empire-backend#1452 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue stretch
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信