FIX: Disable webhooks on 410 and 404 HTTP responses (#7392)

FIX: Disable webhooks on 410 and 404 HTTP responses (#7392)
This commit is contained in:
Tarek Khalil
2019-04-18 12:36:37 +01:00
committed by GitHub
parent 7d301cd0dd
commit 6e46197bc8
6 changed files with 107 additions and 46 deletions

View File

@@ -599,6 +599,19 @@ class StaffActionLogger
))
end
def log_web_hook_deactivate(web_hook, response_http_status, opts = {})
context = [
"webhook_id: #{web_hook.id}",
"webhook_response_status: #{response_http_status}"
]
UserHistory.create!(params.merge(
action: UserHistory.actions[:web_hook_deactivate],
context: context,
details: I18n.t('staff_action_logs.webhook_deactivation_reason', status: response_http_status)
))
end
def log_embeddable_host(embeddable_host, action, opts = {})
old_values, new_values = get_changes(opts[:changes])