fix(webhook): update webhook endpoint path to include 'post'
This commit is contained in:
1 parent
03b67dc3c0
commit
a9ff252f45
4 files changed
+5
-5
No files matched your search
+1
-1
@@ -107,7 +107,7 @@ type ControllerMethodConfig struct {
|
||||
// WebhookEndpointConfig holds a single incoming webhook endpoint. Endpoints are
|
||||
// keyed by name under webhook.endpoints; the name is the last path segment of
|
||||
// the endpoint's URL, so an endpoint named "example" is served at
|
||||
// POST /api/webhook/example. One endpoint per external application and target
|
||||
// POST /api/webhook/post/example. One endpoint per external application and target
|
||||
// channel group keeps their tokens and recipients apart.
|
||||
type WebhookEndpointConfig struct {
|
||||
// Enabled controls whether the endpoint accepts requests. A disabled
|
||||
|
||||
@@ -32,7 +32,7 @@ const sections = [
|
||||
{ key: 'showTriggerCmdEcho', type: 'bool', label: 'Trigger command echo' },
|
||||
{ key: 'showKomariTaskEcho', type: 'bool', label: 'Komari task echo' },
|
||||
{ key: 'showFlapTolerantEcho', type: 'bool', label: 'Flap inhibition echo' },
|
||||
{ key: 'onebotIgnoreSelfMsg', type: 'bool', label: 'Ignore OneBot self messages' }
|
||||
{ key: 'oneBotIgnoreSelfMsg', type: 'bool', label: 'Ignore OneBot self messages' }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+2
-2
@@ -24,12 +24,12 @@ type webhookRequest struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// WebhookHandler handles POST /api/webhook/{name}, the incoming webhook API
|
||||
// WebhookHandler handles POST /api/webhook/post/{name}, the incoming webhook API
|
||||
// served on its own listener (see webhook in config.json). The path segment
|
||||
// selects the endpoint, which carries the token to present and the notification
|
||||
// channels to deliver to:
|
||||
//
|
||||
// POST /api/webhook/example
|
||||
// POST /api/webhook/post/example
|
||||
// {"token": "...", "subject": "...", "content": "..."}
|
||||
//
|
||||
// The alert is rendered per channel and sent through every channel the endpoint
|
||||
|
||||
@@ -61,7 +61,7 @@ func SetupRouter() *http.ServeMux {
|
||||
// SetupRouter it is served on its own listener (webhook.listenAddr/listenPort),
|
||||
// so external applications can be given access to the webhook port without
|
||||
// reaching the admin API. Every endpoint configured under webhook.endpoints is
|
||||
// reachable as /api/webhook/<name>.
|
||||
// reachable as /api/webhook/post/{name}.
|
||||
func SetupWebhookRouter() *http.ServeMux {
|
||||
postLog.Info("Setting up webhook routers...")
|
||||
|
||||
|
||||
Reference in new issue
Block a user