diff --git a/packages/insomnia/src/main/network/libcurl-promise.ts b/packages/insomnia/src/main/network/libcurl-promise.ts index 942fcbed420..9871b0f60fd 100644 --- a/packages/insomnia/src/main/network/libcurl-promise.ts +++ b/packages/insomnia/src/main/network/libcurl-promise.ts @@ -29,6 +29,8 @@ export interface CurlRequestOptions { caCertficatePath: string | null; socketPath?: string; authHeader?: { name: string; value: string }; + // make libcurl not decompress the response content + noDecompress?: boolean; } interface RequestUsedHere { headers: any; @@ -102,7 +104,7 @@ export const curlRequest = (options: CurlRequestOptions) => new Promise new Promise new Promise { const debugTimeline: ResponseTimelineEntry[] = []; const curl = new Curl(); curl.setOpt(Curl.option.URL, finalUrl); socketPath && curl.setOpt(Curl.option.UNIX_SOCKET_PATH, socketPath); - curl.setOpt(Curl.option.VERBOSE, true); // Set all the basic options - curl.setOpt(Curl.option.NOPROGRESS, true); // True so debug function works - curl.setOpt(Curl.option.ACCEPT_ENCODING, ''); // True so curl doesn't print progress + // Set all the basic options + + // True so debug function works + curl.setOpt(Curl.option.VERBOSE, true); + // True so curl doesn't print progress + curl.setOpt(Curl.option.NOPROGRESS, true); + // whether to decompress response content + curl.setOpt(Curl.option.ACCEPT_ENCODING, noDecompress ? null : ''); // fallback to root certificates or leave unset to use keychain on macOS if (caCert) { curl.setOpt(Curl.option.CAINFO_BLOB, caCert);