pubsub.publish mangles binary buffers #569
Description
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.