From 4308152a0881e9ce841b99a253ccda0cb2f259d0 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Tue, 21 Apr 2020 23:35:49 -0400 Subject: [PATCH] fix: uriencode git user/pass for http remote --- server/modules/storage/git/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/storage/git/storage.js b/server/modules/storage/git/storage.js index 2be4a23c..3fd7e313 100644 --- a/server/modules/storage/git/storage.js +++ b/server/modules/storage/git/storage.js @@ -88,9 +88,9 @@ module.exports = { WIKI.logger.info('(STORAGE/GIT) Adding origin remote via HTTP/S...') let originUrl = '' if (_.startsWith(this.config.repoUrl, 'http')) { - originUrl = this.config.repoUrl.replace('://', `://${this.config.basicUsername}:${this.config.basicPassword}@`) + originUrl = this.config.repoUrl.replace('://', `://${encodeURI(this.config.basicUsername)}:${encodeURI(this.config.basicPassword)}@`) } else { - originUrl = `https://${this.config.basicUsername}:${this.config.basicPassword}@${this.config.repoUrl}` + originUrl = `https://${encodeURI(this.config.basicUsername)}:${encodeURI(this.config.basicPassword)}@${this.config.repoUrl}` } await this.git.addRemote('origin', originUrl) break