RequestValidator returns false, even when the strings both match
jacobwarren opened this issue · 2 comments
Below is my code to validate incoming SMS requests.
At first I thought it was user error on my part, but after checking the stack trace, the strings that RequestValidator are comparing to each other are the exact same. Yet it still returns false.
Is this a known issue with RequestValidator, or am I doing something wrong?
defmodule GrowgladWeb.Hooks.MessagesController do
use GrowgladWeb, :controller
def receive(conn, params) do
url = "https://api.growglad.com/hooks/messages/receive"
token = Application.get_env(:ex_twilio, :auth_token)
signature = List.to_string(get_req_header(conn, "x-twilio-signature"))
if ExTwilio.RequestValidator.valid?(url, params, signature, token) do
IO.inspect("The text is valid!")
Honeydew.async({:receive_sms, [params]}, :queue)
else
IO.inspect("The text is invalid!")
end
end
end
Ps. Big fan of your learnelixir.tv and learnphoenix.tv websites! That's how I learned/am learning!
@jacobwarren this is not a known issue with RequestValidator as far as I am aware. I am adding this to my calendar to look into in the next few days. In the meantime, did you discover anything new since you posted this that might help?
I'm closing this down for now. Feel free to reopen if you encounter this in the future.