[BUG]: Scraper passes headers as query params in requests.get (User-Agent never sent)
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 92/100
Línea de trabajo
Empieza en backend/app/modules/scraper/extractor.py, en Article_extractor._fetch_html(). Ejecuta el comando uv proporcionado desde el directorio backend/ para observar el comportamiento actual de las solicitudes. La tarea estará terminada cuando el User-Agent configurado se envíe como encabezado y los encabezados ya no se serialicen en los parámetros de consulta de la URL.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 58
- Forks
- 90
- Merge medio
- 11 h 51 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AOSSIE-Org/Perspective
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
AOSSIE-Org/Perspective#191 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
AOSSIE-Org/Perspective#190 ·
-
[BUG]: Missing input validation in URlRequest and ChatQuery causes 500 crashes and wasteful scraper executionPosiblemente ocupada @agarwalpranav0711 la tomó hace 25 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AOSSIE-Org/Perspective#178 ·
-
[BUG]: chunk_rag_data crashes with ValueError when perspective is a dict, silently dropping RAG vector storagePosiblemente ocupada @agarwalpranav0711 la tomó hace 36 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
AOSSIE-Org/Perspective#175 ·
-
docs: frontend/README.md is the default create-next-app boilerplatePosiblemente ocupada @Th-Shivam la tomó hace 51 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
AOSSIE-Org/Perspective#159 · 1 comentario ·
Todos los issues de AOSSIE-Org/Perspective
Issues similares
-
documentation lens:human needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
thebristolsound/birdbrain#2246 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
A voting window past about 69.9 million hours stores a deadline that reads back as no deadlineAbiertobug ready-for-human
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
BoardGamesEmpire/board-games-empire-backend#1452 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue stretch
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día