forked from extern/bruno
fix(#354): add set headers to introspection request
This commit is contained in:
parent
d2b35beb6f
commit
7f17999486
@ -16,6 +16,7 @@ const prepareGqlIntrospectionRequest = (endpoint, envVars, request) => {
|
||||
method: 'POST',
|
||||
url: endpoint,
|
||||
headers: {
|
||||
...mapHeaders(request.headers),
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
@ -38,4 +39,10 @@ const prepareGqlIntrospectionRequest = (endpoint, envVars, request) => {
|
||||
return axiosRequest;
|
||||
};
|
||||
|
||||
const mapHeaders = (headers) => {
|
||||
const entries = headers.filter((header) => header.enabled).map(({ name, value }) => [name, value]);
|
||||
|
||||
return Object.fromEntries(entries);
|
||||
};
|
||||
|
||||
module.exports = prepareGqlIntrospectionRequest;
|
||||
|
Loading…
Reference in New Issue
Block a user