Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
restrict req.backend to a config origin
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Apr 11, 2017
1 parent c8e5998 commit ef9c296
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ app.use(function (req, res, next) {
}
}
req.abTests = authInfo.abTests || {};
req.backend = `${req.protocol}://${req.headers.host}`;
const host = req.headers.host === config.contentOrigin ? config.contentOrigin : config.siteOrigin;
req.backend = `${req.protocol}://${host}`;
req.config = config;
next();
});
Expand Down

0 comments on commit ef9c296

Please # to comment.