From cdec24ed099ea4ca06ebdc91af9fb3e6e89993e3 Mon Sep 17 00:00:00 2001 From: Aditya Nagla Date: Sun, 12 Jul 2020 17:04:31 +0530 Subject: [PATCH] Add Content-Type header to Slack notifier - req. for discord --- lib/exception_notifier/slack_notifier.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/exception_notifier/slack_notifier.rb b/lib/exception_notifier/slack_notifier.rb index cf3ffed6..92f0a1ae 100644 --- a/lib/exception_notifier/slack_notifier.rb +++ b/lib/exception_notifier/slack_notifier.rb @@ -72,6 +72,9 @@ def information_from_options(exception_class, options) exception_name = "*#{measure_word}* `#{exception_class}`" env = options[:env] + options[:headers] ||= {} + options[:headers]['Content-Type'] = 'application/json' + if env.nil? data = options[:data] || {} text = "#{exception_name} *occured in background*\n"