oven-sh/bun · error · bun_http::Error

RequestBodyNotReusable

Error message

RequestBodyNotReusable

What it means

A redirect requires re-sending the request body, but the body stream has already been consumed and cannot be replayed. Non-rewindable streams (e.g., a one-shot ReadableStream) cannot be re-sent on the redirected request.

Solutions

  1. Buffer the request body before sending so it can be replayed on redirect
  2. Use a Blob, ArrayBuffer, or string body instead of a stream for requests that may redirect
  3. Disable automatic redirect following and handle redirects manually
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/http/error.rs:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/6e6bda78586157b5. Report an issue: GitHub.

Appendix: source

Thrown at src/http/error.rs:64

    #[error("ConnectionRefused")]
    ConnectionRefused,
    #[error("TooManyRedirects")]
    TooManyRedirects,
    #[error("HTTP3Unsupported")]
    HTTP3Unsupported,
    #[error("ResponseHeadersTooLarge")]
    ResponseHeadersTooLarge,
    #[error("UnrequestedUpgrade")]
    UnrequestedUpgrade,
    #[error("UnexpectedData")]
    UnexpectedData,
    #[error("InvalidHTTPResponse")]
    InvalidHTTPResponse,
    #[error("InvalidContentLength")]
    InvalidContentLength,
    #[error("UnsupportedTransferEncoding")]
    UnsupportedTransferEncoding,
    #[error("RequestBodyNotReusable")]
    RequestBodyNotReusable,
    #[error("UnsupportedRedirectProtocol")]
    UnsupportedRedirectProtocol,
    #[error("RedirectURLTooLong")]
    RedirectURLTooLong,
    #[error("RedirectURLInvalid")]
    RedirectURLInvalid,
    #[error("InvalidRedirectURL")]
    InvalidRedirectURL,
    #[error("UnexpectedRedirect")]
    UnexpectedRedirect,
    #[error("ShortRead")]
    ShortRead,
    #[error("WantRead")]
    WantRead,
    #[error("WantWrite")]
    WantWrite,
    #[error("HTTP3HandshakeFailed")]

View on GitHub (pinned to 8c5296ac45)