Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 21:10:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 21:10:16 +0300
commitd66aa9b2992a7d44cc6bae54dfa1c3ba08ad8ef4 (patch)
tree8d3810dbd41295262b1282567ff8020cd61bf6ff /app/services/web_hook_service.rb
parent8ad0af586ed73d33493fe91a0f5204953c7e701a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/web_hook_service.rb')
-rw-r--r--app/services/web_hook_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/web_hook_service.rb b/app/services/web_hook_service.rb
index 5bad2a1583c..27b29feed50 100644
--- a/app/services/web_hook_service.rb
+++ b/app/services/web_hook_service.rb
@@ -36,7 +36,9 @@ class WebHookService
attr_accessor :hook, :data, :hook_name, :request_options
attr_reader :uniqueness_token
- def self.hook_to_event(hook_name)
+ def self.hook_to_event(hook_name, hook = nil)
+ return hook.class.name.titleize if hook.is_a?(SystemHook)
+
hook_name.to_s.singularize.titleize
end
@@ -194,7 +196,7 @@ class WebHookService
headers = {
'Content-Type' => 'application/json',
'User-Agent' => "GitLab/#{Gitlab::VERSION}",
- Gitlab::WebHooks::GITLAB_EVENT_HEADER => self.class.hook_to_event(hook_name),
+ Gitlab::WebHooks::GITLAB_EVENT_HEADER => self.class.hook_to_event(hook_name, hook),
Gitlab::WebHooks::GITLAB_UUID_HEADER => SecureRandom.uuid,
Gitlab::WebHooks::GITLAB_INSTANCE_HEADER => Gitlab.config.gitlab.base_url
}