From 8beaaa9f539f99df8c8f5425494cdc86b7828f9c Mon Sep 17 00:00:00 2001 From: Josh Worden Date: Thu, 2 Aug 2018 11:07:08 -0500 Subject: [PATCH] Prevent SNI errors due to host header in prod --- src/apollo/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apollo/client.js b/src/apollo/client.js index bc24ca1..8a37644 100644 --- a/src/apollo/client.js +++ b/src/apollo/client.js @@ -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 }) => {