From d08c34d85224becfef5e66cec24c5af5ac67f5c5 Mon Sep 17 00:00:00 2001 From: Callum Hopkins Date: Fri, 23 Nov 2018 15:46:18 +0000 Subject: [PATCH 1/2] Added in empty catch for json_decode Lumen and possible other setups are not having their JSON content decoded in the Symfony request. This is an attempt to capture any missed content from Symfony's `request->all()` method and prepare it for Botman to carry on delivering the response --- src/WebDriver.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WebDriver.php b/src/WebDriver.php index afeb3e5..a27d2d3 100644 --- a/src/WebDriver.php +++ b/src/WebDriver.php @@ -51,6 +51,9 @@ class WebDriver extends HttpDriver public function buildPayload(Request $request) { $this->payload = $request->request->all(); + if(!empty($request->getContent()) && empty($this->payload)){ + $this->payload = json_decode($request->getContent(), true); + } $this->event = Collection::make($this->payload); $this->files = Collection::make($request->files->all()); $this->config = Collection::make($this->config->get('web', [])); From 019990006e69a03f9996f2b42fc688fca0ceb826 Mon Sep 17 00:00:00 2001 From: Callum Hopkins Date: Tue, 27 Nov 2018 15:28:31 +0000 Subject: [PATCH 2/2] Update composer.json breaks composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3feeb53..26d1d9b 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": ">=7.0", - "botman/botman": "~3.0" + "botman/botman": "~2.4.1" }, "require-dev": { "botman/studio-addons": "~1.0",