summaryrefslogtreecommitdiff
path: root/app/models/hooks
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-01-07 06:28:24 -0800
committerStan Hu <stanhu@gmail.com>2016-01-07 06:28:24 -0800
commit8386edafd13c8cca1c6ed45abbbc554351300e9d (patch)
tree65f9a9f853aaf41851552531b330c51500b923ed /app/models/hooks
parent61561a9eeb1dbb8273a1e8c8a5f37c0c01917c99 (diff)
downloadgitlab-ce-8386edafd13c8cca1c6ed45abbbc554351300e9d.tar.gz
Accept 2xx status codes for successful Web hook triggers
Closes https://github.com/gitlabhq/gitlabhq/issues/9956
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 40eb0e20b4b..b12a45e922a 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -60,7 +60,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]