mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 16:03:39 +01:00
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