Skip to content

Commit

Permalink
add encode (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyuhang0 authored Jan 11, 2024
1 parent 57cffe6 commit e3f9136
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/serverless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export async function postQuery<T>(config: Config, body, session = '', isolation
Authorization: `Basic ${auth}`,
'TiDB-Database': database,
'TiDB-Session': session,
'X-Debug-Trace-Id': requestId
'X-Debug-Trace-Id': requestId,
'Accept-Encoding': 'gzip'
}
if (isolationLevel) {
headers['TiDB-Isolation-Level'] = isolationLevel
Expand All @@ -41,6 +42,8 @@ export async function postQuery<T>(config: Config, body, session = '', isolation
if (debug) {
const traceId = response?.headers?.get('X-Debug-Trace-Id')
console.log(`[serverless-js debug] response id: ${traceId}`)
const contentEncoding = response?.headers?.get('Content-Encoding')
console.log(`[serverless-js debug] Content-Encoding: ${contentEncoding}`)
}

if (response.ok) {
Expand Down

0 comments on commit e3f9136

Please sign in to comment.