Closed Swimburger closed 2 years ago
We'll have to wait until .NET 7 is released in November to build it in CI.
This is a breaking change which I can revert, but I made the RequestValidationHelpers static since they are pure functions and the class doesn't store any instance data.
This feature is for .NET 7 only. It add the
ValidateTwilioRequestFilter
which can be used to verify HTTP request originated from Twilio in Minimal APIs.Usage:
You can also apply this to a group:
Alternatively, you can add the
ValidateTwilioRequestFilter
filter yourself instead of using the.ValidateTwilioRequest
extension method:Before using the
ValidateTwilioRequestFilter
, you have to configure request validation usingbuilder.Services.AddTwilioRequestValidation();
.This PR also contains some extra unit tests for the
ValidateRequest
attribute. Lastly, dotnet6.csproj has been renamed to AspNetCore.csproj.Contributing to Twilio