Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Add configurable limits for HTTP response bodies

Offen
#436 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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

enhancement high priority

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().await at 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-Length responses 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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus roc-lang/basic-cli

Alle Issues in roc-lang/basic-cli

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.