Hi,
I created a workflow with a webhook request for a private app. The webhook triggers when the firstname, lastname, email or phone is changed in a contact. It then send a request to a RoR app.
I'm using the code in this sample app. The problem is that when I try to validate the signature, I'm getting the error:
Encoding::UndefinedConversionError ("\xC3" from ASCII-8BIT to UTF-8)
I traced the error to this line in Hubspot::Helpers::WebhooksHelper:
hash_result = Digest::SHA2.hexdigest(source_string.encode('utf-8'))
I managed to remove the error by passing the request_body variable to the validate_signature method like this:
request.raw_post.force_encoding("UTF-8")
The issue is that by doing this, the validate_signature method raises an InvalidSignatureError
I need some help to figure out how to validate the request with this encoding error please
Hi, I created a workflow with a webhook request for a private app. The webhook triggers when the firstname, lastname, email or phone is changed in a contact. It then send a request to a RoR app.
I'm using the code in this sample app. The problem is that when I try to validate the signature, I'm getting the error:
Encoding::UndefinedConversionError ("\xC3" from ASCII-8BIT to UTF-8)
I traced the error to this line in Hubspot::Helpers::WebhooksHelper:
hash_result = Digest::SHA2.hexdigest(source_string.encode('utf-8'))
I managed to remove the error by passing the request_body variable to the validate_signature method like this:
request.raw_post.force_encoding("UTF-8")
The issue is that by doing this, the validate_signature method raises an InvalidSignatureError
I need some help to figure out how to validate the request with this encoding error please
Thanks