Skip to content

Error POST if body is instance of Buffer #4789

Description

@zdm

Bug Description

const res = await fetch( "https://api.github.com/repos/softvisio/playground", {
    "method": "PATCH",
    "body": Buffer.from( "test" ),
    "duplex": "half",
} );

returns error:

Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer

This worked previously.
Introduced in undici v7.19.2.

Reproducible By

Expected Behavior

Logs & Screenshots

Environment

undici: 7.19.2

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions