fix(webhook): update webhook endpoint path to include 'post'
Build / ubuntu-latest (push) Failing after 0s
Build / windows-latest (push) Failing after 1h7m41s

This commit is contained in:
NanamiAdmin committed 2026-11-01 20:45:50 +08:00
1 parent 03b67dc3c0
commit a9ff252f45
4 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -107,7 +107,7 @@ type ControllerMethodConfig struct {
// WebhookEndpointConfig holds a single incoming webhook endpoint. Endpoints are // WebhookEndpointConfig holds a single incoming webhook endpoint. Endpoints are
// keyed by name under webhook.endpoints; the name is the last path segment of // 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 // 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. // channel group keeps their tokens and recipients apart.
type WebhookEndpointConfig struct { type WebhookEndpointConfig struct {
// Enabled controls whether the endpoint accepts requests. A disabled // Enabled controls whether the endpoint accepts requests. A disabled
+1 -1
View File
@@ -32,7 +32,7 @@ const sections = [
{ key: 'showTriggerCmdEcho', type: 'bool', label: 'Trigger command echo' }, { key: 'showTriggerCmdEcho', type: 'bool', label: 'Trigger command echo' },
{ key: 'showKomariTaskEcho', type: 'bool', label: 'Komari task echo' }, { key: 'showKomariTaskEcho', type: 'bool', label: 'Komari task echo' },
{ key: 'showFlapTolerantEcho', type: 'bool', label: 'Flap inhibition 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
View File
@@ -24,12 +24,12 @@ type webhookRequest struct {
Content string `json:"content"` 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 // 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 // selects the endpoint, which carries the token to present and the notification
// channels to deliver to: // channels to deliver to:
// //
// POST /api/webhook/example // POST /api/webhook/post/example
// {"token": "...", "subject": "...", "content": "..."} // {"token": "...", "subject": "...", "content": "..."}
// //
// The alert is rendered per channel and sent through every channel the endpoint // The alert is rendered per channel and sent through every channel the endpoint
+1 -1
View File
@@ -61,7 +61,7 @@ func SetupRouter() *http.ServeMux {
// SetupRouter it is served on its own listener (webhook.listenAddr/listenPort), // SetupRouter it is served on its own listener (webhook.listenAddr/listenPort),
// so external applications can be given access to the webhook port without // so external applications can be given access to the webhook port without
// reaching the admin API. Every endpoint configured under webhook.endpoints is // 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 { func SetupWebhookRouter() *http.ServeMux {
postLog.Info("Setting up webhook routers...") postLog.Info("Setting up webhook routers...")