mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
fix mongodb tests
This commit is contained in:
@@ -64,7 +64,7 @@ mongoModule.helpers.mongo = require('./mongo/helpers');
|
|||||||
|
|
||||||
mongoModule.getConnectionString = function () {
|
mongoModule.getConnectionString = function () {
|
||||||
var usernamePassword = '';
|
var usernamePassword = '';
|
||||||
var uri = nconf.get('mongo:uri');
|
var uri = nconf.get('mongo:uri') || '';
|
||||||
if (nconf.get('mongo:username') && nconf.get('mongo:password')) {
|
if (nconf.get('mongo:username') && nconf.get('mongo:password')) {
|
||||||
usernamePassword = nconf.get('mongo:username') + ':' + encodeURIComponent(nconf.get('mongo:password')) + '@';
|
usernamePassword = nconf.get('mongo:username') + ':' + encodeURIComponent(nconf.get('mongo:password')) + '@';
|
||||||
} else if (!uri.includes('@') || !uri.slice(uri.indexOf('://') + 3, uri.indexOf('@'))) {
|
} else if (!uri.includes('@') || !uri.slice(uri.indexOf('://') + 3, uri.indexOf('@'))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user