Request headers are cleaned
See original GitHub issueIn the following code, according to the documentation, request headers should be persisted, but they are cleaned after page is refreshed.
<!DOCTYPE html>
<html>
<head>
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet"/>
</head>
<body style="margin: 0;">
<div id="graphiql" style="height: 100vh;"></div>
<script crossorigin src="https://unpkg.com/react/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
<script crossorigin src="https://unpkg.com/graphiql/graphiql.min.js"></script>
<script>
function graphQLFetcher(graphQLParams, opts = {headers: {}}) {
return fetch(
'/api',
{
method: 'post',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...opts.headers
},
body: JSON.stringify(graphQLParams),
credentials: 'omit',
},
).then(function (response) {
return response.json().catch(function () {
return response.text();
});
});
}
ReactDOM.render(
React.createElement(GraphiQL, {
fetcher: graphQLFetcher,
headerEditorEnabled: true,
}),
document.getElementById('graphiql'),
);
</script>
</body>
</html>
headers: an optional GraphQL string to use as the initial displayed request headers, if undefined is provided, the stored headers will be used.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Best way to clean up HTTP headers, sanitize or Res...
It's a bit more clear of a solution as well as the HTTP::header sanitize function allows some headers but not all essential ones....
Read more >Is there a way to "clean" an accept header in Java?
You can read request headers, and modify response headers in this way (you can not modify request headers, it's a read only map):...
Read more >Clear-Site-Data - HTTP - MDN Web Docs
The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers ...
Read more >HTTP header manipulation - Envoy Proxy
The HTTP connection manager manipulates several HTTP headers both during ... This header is cleaned from external requests, but for internal requests will ......
Read more >Request headers are cleared after updateData() method call
17 to 2.7.20. Request headers are set in report object using 'requestHeaders' property of the data source. On the first load headers are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
shouldPersistHeaders
works, but I wonder if would it be possible forheaders
option to be treated as default when nothing is stored? Currently it always override it.hey @majkrzak, there is a prop
shouldPersistHeaders
you should enable that to persist your headers.