Skip to content

Commit

Permalink
Merge pull request #19 from zarathustra323/hotfix-2.1
Browse files Browse the repository at this point in the history
Force https in prod, do not delete host
  • Loading branch information
zarathustra323 authored Aug 14, 2018
2 parents 01add6b + 6f1cadc commit a25bb70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fortnight-web",
"version": "1.0.0-rc.2",
"version": "1.0.0-rc.2.1",
"main": "index.js",
"author": "Jacob Bare <[email protected]>",
"license": "MIT",
Expand Down
11 changes: 6 additions & 5 deletions src/apollo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import fetch from 'isomorphic-unfetch';

export default (req) => {
const headers = req ? req.headers : {};
const uri = (req) ? `${req.protocol}://${req.get('host')}` : '';
if (headers.host) {
headers['x-forwarded-host'] = headers.host;
delete headers.host;
}
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
const uri = (req) ? `${protocol}://${req.get('host')}` : '';
// 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 a25bb70

Please sign in to comment.