From 0ade973590ece129d673b5f7cab701b4e3f5f464 Mon Sep 17 00:00:00 2001 From: nHuebner <4233660+nHuebner@users.noreply.github.com> Date: Tue, 30 Aug 2022 14:16:56 +0200 Subject: [PATCH] fix: set default header on isomorphic-git to fix BitBucket and AWS CodeCommit git sync (#4865) * fix: set default header f Set deafult header for isomorphic-git httpClient. Deafult behaviour for cli git command adds "Accept: */*" header, to mimic this behaviour an defaultGitAcceptHeader will be set and merged with optional provided config headers. #2220 * fix: change default header behaviour faulty behaviour of merge with config headers, so currently no merge with config.headers * Fix bug where we always only send the Accept header, and miss other headers Co-authored-by: nHuebner Co-authored-by: Filipe Freire --- packages/insomnia/src/sync/git/http-client.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/insomnia/src/sync/git/http-client.ts b/packages/insomnia/src/sync/git/http-client.ts index 6c2cf39f7f..2fa3c574c7 100644 --- a/packages/insomnia/src/sync/git/http-client.ts +++ b/packages/insomnia/src/sync/git/http-client.ts @@ -6,6 +6,10 @@ export const httpClient = { let response; let body: Buffer | null = null; + if (config.headers && !config.headers.Accept) { + config.headers.Accept = '*/*'; + } + if (Array.isArray(config.body)) { body = Buffer.concat(config.body); }