diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-05-03 14:03:10 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-05-03 14:03:10 +0300 |
commit | f4e0c56279007fd6cec3d8e6bd684f0483b0e0ff (patch) | |
tree | a3dbc884f0acbccb5e8d483d1aa3457e4063ead0 /app/models/hooks | |
parent | f0c4f727359a5848d12e2097bad6a6a3190943ef (diff) |
Improve documentation and web test for web hooks
I wanted to share what I learned trying to debug web hooks using
netcat.
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 1e3b4815596..818abbf4cc4 100644 --- a/app/models/hooks/web_hook.rb +++ b/app/models/hooks/web_hook.rb @@ -59,7 +59,7 @@ class WebHook < ActiveRecord::Base basic_auth: auth) end - [(response.code >= 200 && response.code < 300), ActionView::Base.full_sanitizer.sanitize(response.to_s)] + [response.code, 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] |