Request headers are cleaned
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.9k
- Avg merge
- 22h 45m
- Merged PRs (30d)
- 70
Description
In the following code, according to the documentation, request headers should be persisted, but they are cleaned after page is refreshed.
```html
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'),
);
```
```headers: an optional GraphQL string to use as the initial displayed request headers, if undefined is provided, the stored headers will be used.```
Contributor guide
Assessment
This issue has not been assessed yet.