romanzipp / Laravel-Twitch

Twitch Helix API PHP Wrapper for Laravel
https://packagist.org/packages/romanzipp/laravel-twitch
MIT License
108 stars 18 forks source link

Intial setup question #131

Closed pcboii closed 2 years ago

pcboii commented 2 years ago

Laravel 8.83.14 romanzipp/laravel-twitch 4.4

Getting a Invalid content type response from Twitch CLI

twitch event verify-subscription subscribe -F http://localhost:8000/webhooks/twitch/eventsub/ -s 5f1a6e7cd2e7137ccf9e15b2f43fe63949eb84b1db83c1d5a867dc93429de4e4

✔ Valid response. Received challenge 52c24de5-e8fb-1d6a-e52e-a8c787670fff in body ✗ Invalid content-type header. Received type text/html with charset UTF-8. Expecting text/plain. ✔ Valid status code. Received status 200

After revising the code to a manual response, all pass.

✔ Valid response. Received challenge a9298bcd-e8bf-0327-dc0b-e24d3bfc3171 in body ✔ Valid content-type header. Received type text/plain with charset UTF-8 ✔ Valid status code. Received status 200

EventSubController.php (original): https://pastebin.com/gQbFaYcX EventSubController.php (revised): https://pastebin.com/ga3K0jUX

--

Not sure if the aforementioned is related, but also in production env. the status of the event sub is "webhook_callback_verification_failed" with original/revised versions.

Any assistance is appreciated, thanks!

romanzipp commented 2 years ago

You've posted an exception stacktrace in your first edit of this issue Symfony\Component\ErrorHandler\Error\FatalError: Declaration of App\Http\Controllers\EventSubController::handleNotification

I don't see this in the current version, is it still correct or was in unrelated to this issue?