(app)
| 184 | }); |
| 185 | |
| 186 | const setupSecureMiddleware = function(app) { |
| 187 | // Cannot use express request `secure` property in production, due to |
| 188 | // cluster setup. |
| 189 | const isSecure = function() { |
| 190 | return this.secure || (this.headers['x-forwarded-proto'] === 'https'); |
| 191 | }; |
| 192 | |
| 193 | return app.use(function(req, res, next) { |
| 194 | req.isSecure = isSecure; |
| 195 | return next(); |
| 196 | }); |
| 197 | }; |
| 198 | |
| 199 | exports.setupMiddleware = function(app) { |
| 200 | app.use(timeout(config.timeout)); |