From 19bd468694095fd6d848ffe3ca51833bb53dc469 Mon Sep 17 00:00:00 2001 From: minwoox Date: Wed, 28 Aug 2024 11:39:10 +0900 Subject: [PATCH] Fix regex for validating mirror remoteUrl Motivation: The regex for validating mirror remoteUrl is wrong. `[.-\/]` is interpreted as `.` to `/`. However, it should be `[.\-\/]` which allows `.`, `-` and `/` characters. Modifications: - Fixed regex for validating mirror remoteUrl Result: - You can now correctly setup a mirror url when it contains `-` in its name. --- .../src/dogma/features/project/settings/mirrors/MirrorForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/dogma/features/project/settings/mirrors/MirrorForm.tsx b/webapp/src/dogma/features/project/settings/mirrors/MirrorForm.tsx index 33d37c1c7f..a3585b452e 100644 --- a/webapp/src/dogma/features/project/settings/mirrors/MirrorForm.tsx +++ b/webapp/src/dogma/features/project/settings/mirrors/MirrorForm.tsx @@ -300,7 +300,7 @@ const MirrorForm = ({ projectName, defaultValue, onSubmit, isWaitingResponse }: type="text" defaultValue={defaultValue.remoteUrl} placeholder="my.git.com/org/myrepo.git" - {...register('remoteUrl', { required: true, pattern: /^[\w.-]+(:[0-9]+)?\/[\w.-\/]+.git$/ })} + {...register('remoteUrl', { required: true, pattern: /^[\w.-]+(:[0-9]+)?\/[\w.\-\/]+.git$/ })} />