twilio / OpenVBX

OpenVBX is a web-based open source phone system for business.
http://openvbx.org
Other
699 stars 342 forks source link

Twilio Validation doesn't work in lighttpd #282

Open davidsenk opened 10 years ago

davidsenk commented 10 years ago

Was easy enough to fix though (in probably wrong way entirely)

from OpenVBX/libraries/OpenVBX.php return self::$_twilioValidator->validate(self::getRequestSignature(), $url, $post_vars);

$url is not resolved correctly inside of the function validateRequest() or passed to it wrong, I didn't work out where $url came from

Below is what I did to make it actually validate properly instead of a straight return true;

$actual_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
return self::$_twilioValidator->validate(self::getRequestSignature(), $actual_url, $post_vars);

After doing that I no longer get the incredibly annoying response of "Could not validate this request. Goodbye" message. I'm also sure my fix will break if a proxy is placed in front of OpenVBX, but hey, it works for me and thats all I needed.