Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

pubsub.publish mangles binary buffers #569

Closed
@vith

Description

@vith

I was trying to send a CBOR serialized object through the pubsub API and found that the bytes were not being round tripped intact. This is because the Buffer passes through a querystring on its way to the go-ipfs instance, and the qs library being used does not handle a binary buffer safely in this function: https://github.com/ljharb/qs/blob/v6.4.0/lib/utils.js#L88

I have a patch for js-ipfs-api that uses qs.stringify's encoder option to override the encoding of Buffer objects, escaping every byte that isn't an rfc3986 unreserved character without further mutations. I'll submit it as a PR shortly in case it's the desired solution. I'm not familiar enough with this library/spec to say, but maybe the buffer should just be sent in the request body instead of in a query string parameter.

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