Skip to content

Commit

Permalink
fix: uriencode git user/pass for http remote
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Apr 22, 2020
1 parent 6bf0261 commit 4308152
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/modules/storage/git/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4308152

Please sign in to comment.