We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noticed a couple of issues while implementing in Laravel.
php://input
?? ''
Revised code to address these issues:
public function handleWebhookEvent(Request $request, $hook) { $received_signature = $request->header( 'X-Up-Authenticity-Signature' ) ?? ''; $raw_body = $request->getContent(); $signature = hash_hmac('sha256', $raw_body, $hook->secret_key); if (!hash_equals($signature, $received_signature)) { abort(401); } // Process webhook event }
The text was updated successfully, but these errors were encountered:
❤️ Thanks, will fix up the example. Trailing commas are fine, but looks like that was only added with PHP 7.3 so will take that out too.
Sorry, something went wrong.
Fix incoming 🚢
No branches or pull requests
Noticed a couple of issues while implementing in Laravel.
php://input
is problematic for tests, and generally fails in older versions of PHP.?? ''
to ensure variable is non-null.Revised code to address these issues:
The text was updated successfully, but these errors were encountered: