From e3f9136940542a9d9809efd462c37b2bd13f6358 Mon Sep 17 00:00:00 2001 From: shi yuhang <52435083+shiyuhang0@users.noreply.github.com> Date: Thu, 11 Jan 2024 19:56:46 +0800 Subject: [PATCH] add encode (#49) --- src/serverless.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serverless.ts b/src/serverless.ts index d4ccf48..5aec303 100644 --- a/src/serverless.ts +++ b/src/serverless.ts @@ -26,7 +26,8 @@ export async function postQuery(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 @@ -41,6 +42,8 @@ export async function postQuery(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) {