mysociety/popit — pull request #668 by hecticjeff (2014-11-03 10:01:11+00:00)
Title: All apps should trust proxy

The `trust proxy` setting isn't inherited when an app is mounted inside the parent app. To fix this any app which uses express directly needs to have an explicit `app.enable('trust proxy')`. I've also added some code to the `express-inherit` module to ensure that apps which use that inherit the `trust proxy` setting correctly. The API app is an exception because it's mounted inside another app, which in turn is mounted inside a parent, so at the point the API is mounted the parent doesn't have the `trust proxy` setting, so to fix the urls in the API I've set some properties on the request object in the parent app, which does correctly inherit the trust proxy setting.

Part of #326