Skip to content

Commit

Permalink
Prevent SNI errors due to host header in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
solocommand committed Aug 2, 2018
1 parent 40d7109 commit 8beaaa9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apollo/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import withApollo from './WithApollo';
const config = (req) => {
const headers = req ? req.headers : {};
const host = (req) ? req.ROOT_URI : '';
if (headers.host) {
headers['x-forwarded-host'] = headers.host;
delete headers.host;
}
return {
link: ApolloLink.from([
onError(({ graphQLErrors, networkError }) => {
Expand Down

0 comments on commit 8beaaa9

Please sign in to comment.