Skip to content

Commit

Permalink
Merge pull request #15 from solocommand/sni-503s
Browse files Browse the repository at this point in the history
Prevent SNI errors due to host header in prod
  • Loading branch information
zarathustra323 authored Aug 2, 2018
2 parents 40d7109 + 8beaaa9 commit 3d2b6ba
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 3d2b6ba

Please sign in to comment.