Skip to content

Handle raw bytes for response bodies #140

@BSchneppe

Description

@BSchneppe

other pdks define the response body as a byte array
go - https://github.com/extism/go-pdk/blob/12d6f9af953ad4d386b4171442dacdc49a19b777/extism_pdk.go#L294
dotnet - https://github.com/extism/dotnet-pdk/blob/5bd5ce3fa564bd66428348d684fce199837d8eb5/src/Extism.Pdk/Interop.cs#L493

We should support ArrayBuffers as response bodies too, otherwise we fail for non-utf8
here

let body = from_utf8(&body).map_err(|e| to_js_error(cx.clone(), anyhow::Error::from(e)))?;

related: #139

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions