summaryrefslogtreecommitdiff
path: root/app/models/hooks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-01-08 10:56:39 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-01-08 10:56:39 +0000
commit08213ed4f5d35b582f0345d6a825737ced98fd05 (patch)
treef553aced5c87acce551781a1023d04a04d5a054c /app/models/hooks
parent26a54ec34d9bb11656fb2a7a36d1a666218fc61d (diff)
parent8386edafd13c8cca1c6ed45abbbc554351300e9d (diff)
downloadgitlab-ce-08213ed4f5d35b582f0345d6a825737ced98fd05.tar.gz
Merge branch 'accept-2xx-status-codes-for-webhooks' into 'master'
Accept 2xx status codes for successful Web hook triggers Closes https://github.com/gitlabhq/gitlabhq/issues/9956 See merge request !2332
Diffstat (limited to 'app/models/hooks')
-rw-r--r--app/models/hooks/web_hook.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index 7164c0e1e90..d0aadfc330a 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -61,7 +61,7 @@ class WebHook < ActiveRecord::Base
basic_auth: auth)
end
- [response.code == 200, ActionView::Base.full_sanitizer.sanitize(response.to_s)]
+ [(response.code >= 200 && response.code < 300), ActionView::Base.full_sanitizer.sanitize(response.to_s)]
rescue SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::OpenTimeout => e
logger.error("WebHook Error => #{e}")
[false, e.to_s]