[BUG]: Scraper passes headers as query params in requests.get (User-Agent never sent)
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 92/100
Direzione di ricerca
Inizia in backend/app/modules/scraper/extractor.py, in Article_extractor._fetch_html(). Esegui il comando uv fornito dalla directory backend/ per osservare il comportamento attuale delle richieste. Il lavoro è completato quando il User-Agent configurato viene inviato come header e gli header non vengono più serializzati nei parametri di query dell’URL.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 58
- Fork
- 90
- Merge medio
- 11h 51m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/Perspective
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
AOSSIE-Org/Perspective#191 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
AOSSIE-Org/Perspective#190 ·
-
[BUG]: Missing input validation in URlRequest and ChatQuery causes 500 crashes and wasteful scraper executionForse già presa @agarwalpranav0711 l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AOSSIE-Org/Perspective#178 ·
-
[BUG]: chunk_rag_data crashes with ValueError when perspective is a dict, silently dropping RAG vector storageForse già presa @agarwalpranav0711 l’ha presa 36 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
AOSSIE-Org/Perspective#175 ·
-
docs: frontend/README.md is the default create-next-app boilerplateForse già presa @Th-Shivam l’ha presa 51 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
AOSSIE-Org/Perspective#159 · 1 commento ·
Tutte le issue di AOSSIE-Org/Perspective
Issue simili
-
documentation lens:human needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
thebristolsound/birdbrain#2246 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
A voting window past about 69.9 million hours stores a deadline that reads back as no deadlineApertabug ready-for-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
BoardGamesEmpire/board-games-empire-backend#1452 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue stretch
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno