Http: a bodyless GET is sent with Content-Type: text/plain, and with no User-Agent (GitHub's API answers 403)
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #534 de @lukewilliamboswell — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Start by locating Http.send! and send_streaming!, then trace how they add default headers when building a request. Check the HTTP tests for bodyless GET requests and requests with a caller supplied User-Agent. Done means the defaults match the intended behavior for both cases, with tests covering each.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Two default headers surprised me while porting a tool to 0.26.0-rc3:
1. A bodyless GET is sent with Content-Type: text/plain. send_streaming! adds Content-Type: text/plain to any request that does not set one, even when there is no body. What Http.send! sends for Request.from_method(GET).with_uri("http://127.0.0.1:18099/x"), captured with nc -l -p 18099:
GET /x HTTP/1.1
content-type: text/plain
host: 127.0.0.1:18099
A Content-Type describes content, and this request has none. Servers mostly ignore it, but a strict one can refuse it, and it is a header the caller never asked for. Suggestion: add the default only when the body is not empty, or not at all.
2. No User-Agent. GitHub's REST API refuses requests without one:
api = Http.send!(Request.from_method(GET).with_uri("https://api.github.com/repos/roc-lang/basic-cli/branches/main"), {})?
# Response.status(api) == 403
With .add_header("User-Agent", "something") it answers 200. curl, Go's net/http and Python's urllib each send one by default. GitHub is probably the most common API a CLI script talks to, and a 403 with a body about a missing User-Agent is easy to miss. Suggestion: a default such as roc-basic-cli/0.26, replaced by any User-Agent the request sets. Or a line in Http's docs, if a default is not wanted.
Seen on 0.26.0-rc3, Roc nightly-2026-10-17-5f126ac and -10-19, Linux x86_64. Thank you for rc3: details on how it went for us are in #529.
- Lenguaje dominante
- Rust
- Estrellas
- 122
- Forks
- 47
- Merge medio
- 11 h 6 min
- PR fusionados (30 d)
- 21
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 roc-lang/basic-cli
-
Unix socket supportAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
roc-lang/basic-cli#500 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
roc-lang/basic-cli#482 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
roc-lang/basic-cli#455 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
Los mantenedores suelen responder en 1 día
Todos los issues de roc-lang/basic-cli
Issues similares
-
bug needs triage P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
pbakaus/impeccable#1143 ·
Los mantenedores suelen responder en 1 día
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesPosiblemente ocupada @FabienDanieau la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día