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:
authorValery Sizov <vsv2711@gmail.com>2015-04-27 16:29:31 +0300
committerValery Sizov <vsv2711@gmail.com>2015-04-27 16:29:31 +0300
commitbc9ba5237cafd4b24405596f0c9e8af099635c29 (patch)
tree82ded5d3c0cbc39a9bfd0430684757d7309c9a88 /app/models/hooks
parentbb8c1cadf39415d2f916d135e8bbfdce49842f2f (diff)
Revert "Added X-GitLab-Event header for web hooks"
This reverts commit 548f182814acd0f7a110e6c165c186e345901b00.
Diffstat (limited to 'app/models/hooks')
-rw-r--r--app/models/hooks/web_hook.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index e9fd441352d..315d96af1b9 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -30,15 +30,12 @@ class WebHook < ActiveRecord::Base
validates :url, presence: true,
format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }
- def execute(data, hook_name)
+ def execute(data)
parsed_url = URI.parse(url)
if parsed_url.userinfo.blank?
WebHook.post(url,
body: data.to_json,
- headers: {
- "Content-Type" => "application/json",
- "X-Gitlab-Event" => hook_name.singularize.titleize
- },
+ headers: { "Content-Type" => "application/json" },
verify: false)
else
post_url = url.gsub("#{parsed_url.userinfo}@", "")
@@ -48,10 +45,7 @@ class WebHook < ActiveRecord::Base
}
WebHook.post(post_url,
body: data.to_json,
- headers: {
- "Content-Type" => "application/json",
- "X-Gitlab-Event" => hook_name.singularize.titleize
- },
+ headers: { "Content-Type" => "application/json" },
verify: false,
basic_auth: auth)
end
@@ -60,7 +54,7 @@ class WebHook < ActiveRecord::Base
false
end
- def async_execute(data, hook_name)
- Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data, hook_name)
+ def async_execute(data)
+ Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data)
end
end