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

Cannot set a URI for generic webhooks with a route different than /api/* #62

Open
cale-sweeney opened this issue Oct 25, 2021 · 1 comment

Comments

@cale-sweeney
Copy link

cale-sweeney commented Oct 25, 2021

I cannot seem to find a way to set a URI like this for generic webhooks with a route that begins with something like /portalapi/v1/*. E.g. something like this:

            config.Routes.MapHttpRoute(
                name: "PortalApi",
                routeTemplate: "portalapi/v1/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

The webhook receiver only seems to respond to posts from URIs in the form api/*:

           config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

Am I missing something? Or is this a bug? Has anyone been able to change the beginning of the route and have it accepted by the webhook call?

Posted this question on stackoverflow as well:
https://stackoverflow.com/questions/69713805/cannot-set-a-uri-for-asp-net-generic-webhooks-with-a-route-different-than-xyz-co

@cale-sweeney cale-sweeney changed the title Cannot set a URI like this for generic webhooks with a route different than /api/* Cannot set a URI for generic webhooks with a route different than /api/* Oct 25, 2021
@cale-sweeney
Copy link
Author

Looks like that URI is hard coded here:
https://github.com/aspnet/WebHooks/blob/master/src/Microsoft.AspNetCore.WebHooks.Receivers/ApplicationModels/WebHookSelectorModelProvider.cs#L144-L153

I think you should add to the documentation that the base of the URI "/api/webhooks/incoming/" cannot be modified.

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

No branches or pull requests

1 participant