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 <nico.huebner.1985@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
This commit is contained in:
nHuebner
2022-08-30 14:16:56 +02:00
committed by GitHub
parent a662edefd1
commit 0ade973590

View File

@@ -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);
}