Skip to content

Commit

Permalink
fix: regex escaping in repo model
Browse files Browse the repository at this point in the history
  • Loading branch information
msagi committed May 5, 2024
1 parent 360c7c7 commit c5e8659
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/model/Repo.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions test/testRepoModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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//"
Expand Down

0 comments on commit c5e8659

Please sign in to comment.