Skip to content

Commit

Permalink
[GH-982]: Added support for webhook of plugin version v2.x.x (#989)
Browse files Browse the repository at this point in the history
* [MI-3636]:Added support for webhook of plugin version v2.x.x

* [MI-3636]:Added support for legacy webhooks
  • Loading branch information
Kshitij-Katiyar committed Oct 23, 2023
1 parent d1e233a commit ee2da0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ func (p *Plugin) initializeRouter() {
// Firehose webhook setup for channel subscriptions
instanceRouter.HandleFunc(makeAPIRoute(routeAPISubscribeWebhook), p.handleResponseWithCallbackInstance(p.httpSubscribeWebhook)).Methods(http.MethodPost)

// To support Plugin v2.x webhook URLs
apiRouter.HandleFunc(routeAPISubscribeWebhook, p.handleResponseWithCallbackInstance(p.httpSubscribeWebhook)).Methods(http.MethodPost)
instanceRouter.HandleFunc(routeIncomingWebhook, p.handleResponseWithCallbackInstance(p.httpWebhook)).Methods(http.MethodPost)

// Channel Subscriptions
apiRouter.HandleFunc(routeAPISubscriptionsChannelWithID, p.checkAuth(p.handleResponse(p.httpChannelGetSubscriptions))).Methods(http.MethodGet)
apiRouter.HandleFunc(routeAPISubscriptionsChannel, p.checkAuth(p.handleResponse(p.httpChannelCreateSubscription))).Methods(http.MethodPost)
Expand Down

0 comments on commit ee2da0d

Please sign in to comment.