Skip to content

Commit

Permalink
Merge branch 'master' into graphql-eq-op
Browse files Browse the repository at this point in the history
  • Loading branch information
0x777 authored Jan 24, 2019
2 parents c43679e + 8342a96 commit 4bbd6b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions console/src/components/ApiExplorer/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4bbd6b4

Please sign in to comment.