mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
closes #3435
This commit is contained in:
1
app.js
1
app.js
@@ -118,6 +118,7 @@ function start() {
|
||||
var urlObject = url.parse(nconf.get('url'));
|
||||
var relativePath = urlObject.pathname !== '/' ? urlObject.pathname : '';
|
||||
nconf.set('base_url', urlObject.protocol + '//' + urlObject.host);
|
||||
nconf.set('secure', urlObject.protocol === 'https');
|
||||
nconf.set('use_port', !!urlObject.port);
|
||||
nconf.set('relative_path', relativePath);
|
||||
nconf.set('port', urlObject.port || nconf.get('port') || nconf.get('PORT') || 4567);
|
||||
|
||||
@@ -57,6 +57,10 @@ module.exports = function(app) {
|
||||
cookie.domain = meta.config.cookieDomain;
|
||||
}
|
||||
|
||||
if (nconf.get('secure')) {
|
||||
cookie.secure = true;
|
||||
}
|
||||
|
||||
app.use(session({
|
||||
store: db.sessionStore,
|
||||
secret: nconf.get('secret'),
|
||||
|
||||
Reference in New Issue
Block a user