Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Content-Type header to Slack notifier - req. for discord #494

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cdadityang
Copy link

I was working on building discord webhook for this repo, then I came across Discord - Slack Compatible Docs.

This means we can use slack notifier with Discord webhook(plus adding /slack at the end of discord webhook url). Ex:

config.add_notifier :slack, {
    webhook_url: "https://discord.com/api/webhooks/XXXX/XXXXXXXXX/slack"
  }

But the problem is, Discord webhooks requires header Content-Type: application/json set to it. This is pretty standard and recommended for all API apps. Seems that, for Slack API this header is optional, so right now the above discord webhook will fail.

So, I've just added the Content-Type header to the Slack Notifier, this will work for both Slack and Discord.

@coveralls
Copy link

coveralls commented Jul 12, 2020

Coverage Status

Coverage increased (+0.003%) to 96.865% when pulling 1efde75 on cdadityang:master into e9f09b8 on smartinez87:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants