mirror of
https://github.com/Kong/insomnia.git
synced 2026-05-24 16:51:06 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user