Mattermost-plugin-github: Provide a more clear error message when the wrong content type is selected for a webhook

Created on 17 Jun 2019  路  1Comment  路  Source: mattermost/mattermost-plugin-github

Repro:

  1. Follow these steps to configure the GitHub plugin: https://github.com/mattermost/mattermost-plugin-github/#configuration

    • NOTE: To reproduce the error in this issue, when creating the webhook in GitHub in step 2, do not change the content type to "application/json"

  2. Connect your Mattermost account to GitHub with /github connect.
  3. Subscribe a channel to receive notifications with /github subscribe owner/repo.
  4. Trigger an event such as opening an issue in the GitHub repository you subscribed.

Observed: No event, with the following error in server logs

2019-06-17T13:35:18.794Z    info    go-plugin/stream.go:15    {"level":"error","msg":"invalid character 'p' looking for beginning of value"}    {"plugin_id": "github", "source": "plugin_stdout"}

Proposed change:

  1. Update the server log error message to state GitHub webhook content type should be set to "application/json"
  2. Fail the request with a proper status code so that the webhook shows up as failed on GitHub
Help Wanted

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThiefMaster picture ThiefMaster  路  6Comments

mattermod picture mattermod  路  6Comments

lieut-data picture lieut-data  路  4Comments

rien picture rien  路  4Comments

hanzei picture hanzei  路  5Comments