Add configurable limits for HTTP response bodies
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- rust
- Bereich
- cli, networking
Rechercherichtung
Beginne in src/http.rs:141-165, insbesondere bei response.into_body().collect().await in Zeile 155, und prüfe die vorhandene Request-Konfiguration sowie die HTTP-Beispiele. Lege fest, wie das Limit ausgewählt wird und wie der typisierte Fehler offengelegt wird, und setze es dann beim Konsumieren sowohl von Bodies mit fester Länge als auch von chunked Bodies durch. Erledigt ist dies, wenn die Acceptance-Tests Limits unterhalb, genau auf und oberhalb des Grenzwerts sowie chunked Limits abdecken und die bestehenden Beispiele auf unterstützten Targets bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Context
The HTTP host collects the complete response body into memory before returning it to Roc:
src/http.rs:141-165- specifically
response.into_body().collect().awaitat line 155
A slow response can be constrained with the existing request timeout, but there is no response-size limit. A server can therefore return a very large fixed-length or chunked body and cause excessive memory use or an allocation abort.
This matters for a general-purpose CLI platform because URLs and servers are often outside the application's control.
Suggested direction
Add an explicit maximum response-body size to the HTTP API. Design options include:
- a limit on the shared request configuration;
- a platform-level default plus an opt-in override;
- a separate bounded send operation.
Enforce the limit while consuming frames, rather than collecting first and checking afterward. Return a distinct typed error that callers can distinguish from malformed bodies and network failures.
A later streaming response API can be tracked separately; this issue only needs bounded buffering.
Acceptance criteria
- Callers can select or rely on a documented finite response-body limit.
- Both
Content-Lengthresponses and chunked/unknown-length responses are stopped before exceeding the limit. - Exceeding the limit returns a documented typed error rather than panicking or aborting.
- Tests cover a body just below the limit, exactly at it, above it, and a chunked body above it.
- Existing normal HTTP examples continue to pass on every supported target.
- Vorherrschende Sprache
- Rust
- Sterne
- 122
- Forks
- 47
- Ø Merge
- 12 Std. 20 Min.
- Gemergte PRs (30 T.)
- 18
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus roc-lang/basic-cli
-
Unix socket supportOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
roc-lang/basic-cli#500 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
roc-lang/basic-cli#482 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
roc-lang/basic-cli#455 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 32/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in roc-lang/basic-cli
Ähnliche Issues
-
documentation P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue priority:high
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Konfirm-xyz/konfirm-contracts#163 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:gc-repack-output bug factory:dogfood factory:triaged priority:p3 type:bug type:ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
gitbutlerapp/grit#1161 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
feature performance
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
lance-format/lance#10137 ·
Maintainer antworten meist innerhalb von 2 Tagen