Not sure if this is the expected behavior, but it seemed anomalous. I started with a GitHubWebHookAttribute on an action and replaced it with a GeneralWebHook. I configured the appsettings.json and restarted the site. Sending payloads from GitHub worked. I edited the bodyType for the parameter to WebHookBodyType.Form but I continue to see the requests go through:
Controller:
public class ValuesController : ControllerBase
{
[HttpGet("/api/values")]
public IActionResult Get() => Content("Hello");
// GET api/values
[GeneralWebHook(Microsoft.AspNetCore.WebHooks.Metadata.WebHookBodyType.Form, Id ="test")]
public IActionResult Action()
{
return Ok();
}
}
GitHub request:
Application log:
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 POST https://52.175.238.250/api/webhooks/incoming/github/test application/json 5727
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Route matched with {action = "Action", controller = "Values"}. Executing action WebApplication3.Controllers.ValuesController.Action (WebApplication3)
info: Microsoft.AspNetCore.WebHooks.Filters.WebHookReceiverExistsFilter[3]
Processing incoming WebHook request with receiver 'github' and id 'test'.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method WebApplication3.Controllers.ValuesController.Action (WebApplication3) - Validation state: Valid
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action method WebApplication3.Controllers.ValuesController.Action (WebApplication3), returned result Microsoft.AspNetCore.Mvc.OkResult in 0.3254ms.
info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1]
Executing HttpStatusCodeResult, setting HTTP status code 200
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action WebApplication3.Controllers.ValuesController.Action (WebApplication3) in 65.7481ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 217.1139ms 200
Not sure if this is the expected behavior, but it seemed anomalous. I started with a
GitHubWebHookAttribute
on an action and replaced it with aGeneralWebHook
. I configured the appsettings.json and restarted the site. Sending payloads from GitHub worked. I edited thebodyType
for the parameter toWebHookBodyType.Form
but I continue to see the requests go through:Controller:
GitHub request:
Application log:
Application started. Press Ctrl+C to shut down. info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 POST https://52.175.238.250/api/webhooks/incoming/github/test application/json 5727 info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] Route matched with {action = "Action", controller = "Values"}. Executing action WebApplication3.Controllers.ValuesController.Action (WebApplication3) info: Microsoft.AspNetCore.WebHooks.Filters.WebHookReceiverExistsFilter[3] Processing incoming WebHook request with receiver 'github' and id 'test'. info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] Executing action method WebApplication3.Controllers.ValuesController.Action (WebApplication3) - Validation state: Valid info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action method WebApplication3.Controllers.ValuesController.Action (WebApplication3), returned result Microsoft.AspNetCore.Mvc.OkResult in 0.3254ms. info: Microsoft.AspNetCore.Mvc.StatusCodeResult[1] Executing HttpStatusCodeResult, setting HTTP status code 200 info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action WebApplication3.Controllers.ValuesController.Action (WebApplication3) in 65.7481ms info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 217.1139ms 200
Tested using 2.1.0-rc1-30678