diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-01-08 10:56:39 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-01-08 10:56:39 +0000 |
commit | 08213ed4f5d35b582f0345d6a825737ced98fd05 (patch) | |
tree | f553aced5c87acce551781a1023d04a04d5a054c /app/models/hooks | |
parent | 26a54ec34d9bb11656fb2a7a36d1a666218fc61d (diff) | |
parent | 8386edafd13c8cca1c6ed45abbbc554351300e9d (diff) | |
download | gitlab-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.rb | 2 |
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] |