From df7ce07d2ac391e3fd9625d54a3292d225094b07 Mon Sep 17 00:00:00 2001 From: akvlad Date: Thu, 18 Apr 2024 15:23:19 +0300 Subject: [PATCH] fix: axios error. strings -> Buffer to avoid the merge --- lib/db/clickhouse.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/db/clickhouse.js b/lib/db/clickhouse.js index 6f3a32a0..f934708f 100644 --- a/lib/db/clickhouse.js +++ b/lib/db/clickhouse.js @@ -1366,6 +1366,9 @@ const rawRequest = async (query, data, database, config) => { if (data && !(Buffer.isBuffer(data) || data instanceof Uint8Array || typeof data === 'string')) { throw new Error('data must be Buffer, Uint8Array or String: currently the data is: ' + typeof data) } + if (typeof data === 'string') { + data = Buffer.from(data, 'utf8') + } if (typeof query !== 'string') { throw new Error('query must be String: currently the query is: ' + typeof query) }