twilio / twilio-ruby

A Ruby gem for communicating with the Twilio API and generating TwiML
MIT License
1.35k stars 462 forks source link

fix: Make RequestValidator#validate fail if URL has no query params #614

Closed haffla closed 2 years ago

haffla commented 2 years ago

Fixes #613

I ran into this issue when I wrongly expected JSON requests I am making from a Twilio serverless function to one of my services to be correctly verified. I know that Twilio will always include the bodySHA256 query parameter for JSON requests. But if you use Twilio::Security::RequestValidator#validate in a custom way you might pass the wrong URL and in that case it shouldn't crash.

Checklist