You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this after thorough attempts to get my signatures valid at even the smallest requests. It can be reproduced by creating a super simple TwiML App, directing it to some endpoint and trying to validate the incoming request. It will always fail unless the slash is removed.
I solved it by simple modifying the package on this line to use URL[1:] but I am not sure if that is the idealistic way to do so since I'm not sure if you can always guarantee a value there. Was hoping for some input and thoughts.
The text was updated successfully, but these errors were encountered:
Hey @kevinburke, indeed it seems to only occur to the base path "/". I guess this is because req.URL.String() will write the starting slash for the path, even if there is is no URI following. If you validate at /test, for example, there is no issue since there will be no trailing slash.
GetExpectedTwilioSignature
will fail due to thereq.URL.String()
containing a beginning slash/
. This seemingly breaks validation on bothGET
andPOST
requests where it is not there. If any query parameters are present, there is simply a?
and no slash before them. This can be seen in Twilio's example here on line 17: https://www.twilio.com/docs/usage/security?code-sample=code-validate-signature-of-request&code-language=java&code-sdk-version=7.xI found this after thorough attempts to get my signatures valid at even the smallest requests. It can be reproduced by creating a super simple TwiML App, directing it to some endpoint and trying to validate the incoming request. It will always fail unless the slash is removed.
I solved it by simple modifying the package on this line to use
URL[1:]
but I am not sure if that is the idealistic way to do so since I'm not sure if you can always guarantee a value there. Was hoping for some input and thoughts.The text was updated successfully, but these errors were encountered: