Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Fixed http-client dht/put #3516

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ipfs-core/src/components/dht.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = ({ network, repo }) => {
* form, this will write that value to the DHT with
* that key.
*
* @param {Uint8Array} key
* @param {Uint8Array|string} key
* @param {Uint8Array} value
* @param {AbortOptions} [options]
* @returns {AsyncIterable<QueryEvent>}
Expand Down
3 changes: 2 additions & 1 deletion packages/ipfs-http-client/src/dht/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const multiaddr = require('multiaddr')
const toCamel = require('../lib/object-to-camel')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const uint8ArrayToString = require('uint8arrays/to-string')
const multipartRequest = require('../lib/multipart-request')
const { anySignal } = require('any-signal')
const AbortController = require('native-abort-controller')
Expand All @@ -21,7 +22,7 @@ module.exports = configure(api => {
timeout: options.timeout,
signal,
searchParams: toUrlSearchParams({
arg: key,
arg: key instanceof Uint8Array ? uint8ArrayToString(key) : key,
...options
}),
...(
Expand Down