diff --git a/src/model/Repo.js b/src/model/Repo.js index 52fabe1c..89212e5f 100644 --- a/src/model/Repo.js +++ b/src/model/Repo.js @@ -1,6 +1,5 @@ // Regex inspector - https://www.debuggex.com/ -// eslint-disable-next-line no-useless-escape -const GIT_URL_REGEX = new RegExp("^(https)://(github\.com|gitlab\.com)/([a-zA-Z0-9\-\.]+)/([a-zA-Z0-9\-]+)(\.git)(/)?$"); +const GIT_URL_REGEX = new RegExp("^(https)://(github\\.com|gitlab\\.com)/([a-zA-Z0-9\\-\\.]+)/([a-zA-Z0-9\\-]+)(\\.git)(/)?$"); /** Class representing a Repo. */ class Repo { diff --git a/test/testRepoModel.js b/test/testRepoModel.js index d2a9c368..07c63271 100644 --- a/test/testRepoModel.js +++ b/test/testRepoModel.js @@ -34,6 +34,8 @@ describe('model', async () => { null, "https://github.com/finos/proxy", "http://github.com/finos/git-proxy.git", + "https://github..com/finos/git-proxy.git", + "https://github.com/finos/git-proxy..git", "https://bitbucket.com/finos/git-proxy.git", "https://github/Citi/citi-ospo.git", "https://github.com/RBC/finos-traderX.git//"