Skip to content

Commit

Permalink
fix: axios error. strings -> Buffer to avoid the merge
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Apr 18, 2024
1 parent e3f7713 commit df7ce07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/db/clickhouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit df7ce07

Please sign in to comment.