diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/controllers/concerns/web_hooks/hook_actions.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/controllers/concerns/web_hooks/hook_actions.rb')
-rw-r--r-- | app/controllers/concerns/web_hooks/hook_actions.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/concerns/web_hooks/hook_actions.rb b/app/controllers/concerns/web_hooks/hook_actions.rb index ea11f13c7ef..75065ef9d24 100644 --- a/app/controllers/concerns/web_hooks/hook_actions.rb +++ b/app/controllers/concerns/web_hooks/hook_actions.rb @@ -20,7 +20,7 @@ module WebHooks unless hook.valid? self.hooks = relation.select(&:persisted?) - flash[:alert] = hook.errors.full_messages.join.html_safe + flash[:alert] = hook.errors.full_messages.to_sentence.html_safe end redirect_to action: :index @@ -53,6 +53,8 @@ module WebHooks ps = params.require(:hook).permit(*permitted).to_h + ps.delete(:token) if action_name == 'update' && ps[:token] == WebHook::SECRET_MASK + ps[:url_variables] = ps[:url_variables].to_h { [_1[:key], _1[:value].presence] } if ps.key?(:url_variables) if action_name == 'update' && ps.key?(:url_variables) @@ -64,7 +66,9 @@ module WebHooks end def hook_param_names - %i[enable_ssl_verification token url push_events_branch_filter] + param_names = %i[enable_ssl_verification token url push_events_branch_filter] + param_names.push(:branch_filter_strategy) if Feature.enabled?(:enhanced_webhook_support_regex) + param_names end def destroy_hook(hook) |