Permalink
Browse files

use de-JSON'd objects instead of raw strings

  • Loading branch information...
1 parent 9e25089 commit 0c040e2d6d2a3939950dbb998c08227c8fafb9a6 @rtomayko rtomayko committed Jan 27, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 github-services.rb
View
@@ -54,12 +54,13 @@ def service(name)
yield data, payload
end
rescue => boom
- hook_data = params[:data].dup
+ # redact sensitive info in hook_data hash
+ hook_data = data || params[:data]
%w[password token].each { |key| hook_data[key] &&= '<redacted>' }
report_exception boom,
:hook_name => name,
- :hook_data => hook_data,
- :hook_payload => params[:payload]
+ :hook_data => hook_data.inspect,
+ :hook_payload => (payload || params[:payload]).inspect
raise
end
end

0 comments on commit 0c040e2

Please sign in to comment.