Skip to content

Commit

Permalink
Updates webhooks RegExp to allow undescores, fixes strapi#5543 (strap…
Browse files Browse the repository at this point in the history
…i#7079)

Signed-off-by: Maxwell Simmer <maxwell.simmer@gmail.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
  • Loading branch information
msimmer authored and onepointconsulting committed Aug 13, 2020
1 parent 4b4cd04 commit c71a49b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/strapi-admin/controllers/Webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ALLOWED_EVENTS = [
'media.delete',
];

const urlRegex = /^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/;
const urlRegex = /^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9_]-*)*[a-z\u00a1-\uffff0-9_]+)(?:\.(?:[a-z\u00a1-\uffff0-9_]-*)*[a-z\u00a1-\uffff0-9_]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/;

const webhookValidator = yup
.object({
Expand Down

0 comments on commit c71a49b

Please sign in to comment.