소스 검색

fix: uriencode git user/pass for http remote

NGPixel 5 년 전
부모
커밋
4308152a08
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      server/modules/storage/git/storage.js

+ 2 - 2
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