mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
parent
5b66ca8c42
commit
8342a962d5
@ -242,6 +242,18 @@ const analyzeFetcher = (url, headers, analyzeApiChange) => {
|
||||
'x-hasura-role': 'admin',
|
||||
};
|
||||
}
|
||||
|
||||
// Check if x-hasura-role is available in some form in the headers
|
||||
const totalHeaders = Object.keys(reqHeaders);
|
||||
totalHeaders.forEach((t) => {
|
||||
// If header has x-hasura-*
|
||||
const lHead = t.toLowerCase();
|
||||
if (lHead.slice(0, 'x-hasura-'.length) === 'x-hasura-') {
|
||||
user[lHead] = reqHeaders[t];
|
||||
delete reqHeaders[t];
|
||||
}
|
||||
});
|
||||
|
||||
editedQuery.user = user;
|
||||
return fetch(`${url}/explain`, {
|
||||
method: 'post',
|
||||
|
Loading…
Reference in New Issue
Block a user