Closed peter-assi closed 2 years ago
According to the docs the check here should only happen for application/json request https://github.com/twilio/twilio-go/blob/main/client/request_validator.go#L56 thus alway returning false for form encoded request since they don't send the bodySHA256 param.
application/json
bodySHA256
Also according to the docs, the body params should be concatenated to the url. The code here https://github.com/twilio/twilio-go/blob/main/client/request_validator.go#L36 needs to be changed to
paramSlc = append(paramSlc, fmt.Sprintf("%s%s", k, v[0]))
As it is now it will put [] around the values since url.Parse returns the value as an array. Ie instead of https://example.comparamvalue the result will be https://example.comparam[value]
[]
url.Parse
https://example.comparamvalue
https://example.comparam[value]
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
Issue Summary
According to the docs the check here should only happen for
application/json
request https://github.com/twilio/twilio-go/blob/main/client/request_validator.go#L56 thus alway returning false for form encoded request since they don't send thebodySHA256
param.Also according to the docs, the body params should be concatenated to the url. The code here https://github.com/twilio/twilio-go/blob/main/client/request_validator.go#L36 needs to be changed to
As it is now it will put
[]
around the values sinceurl.Parse
returns the value as an array. Ie instead ofhttps://example.comparamvalue
the result will behttps://example.comparam[value]