Browse Source

fix: uriencode git user/pass for http remote

pull/1757/head
NGPixel 4 years ago
parent
commit
4308152a08
1 changed files with 2 additions and 2 deletions
  1. 4
      server/modules/storage/git/storage.js

4
server/modules/storage/git/storage.js

@ -88,9 +88,9 @@ module.exports = {
WIKI.logger.info('(STORAGE/GIT) Adding origin remote via HTTP/S...') WIKI.logger.info('(STORAGE/GIT) Adding origin remote via HTTP/S...')
let originUrl = '' let originUrl = ''
if (_.startsWith(this.config.repoUrl, 'http')) { 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 { } 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) await this.git.addRemote('origin', originUrl)
break break

Loading…
Cancel
Save