From a675fe6a927fbe034fa81f0e74ce93e4c615f028 Mon Sep 17 00:00:00 2001
From: Fabio Manganiello <info@fabiomanganiello.com>
Date: Wed, 31 Aug 2022 00:49:08 +0200
Subject: [PATCH] Updated CHANGELOG

---
 CHANGELOG.md                         | 10 +++++++++-
 platypush/message/event/http/hook.py |  4 +++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e6ec694c4..2e65edc1c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,15 @@
 # Changelog
 
 All notable changes to this project will be documented in this file.
-Given the high speed of development in the first phase, changes are being reported only starting from v0.20.2.
+Given the high speed of development in the first phase, changes are being
+reported only starting from v0.20.2.
+
+## [Unreleased]
+
+### Added
+
+- Added support for web hooks returning their hook method responses back to the
+  HTTP client.
 
 ## [0.23.4] - 2022-08-28
 
diff --git a/platypush/message/event/http/hook.py b/platypush/message/event/http/hook.py
index 1c1690d91..728a13c57 100644
--- a/platypush/message/event/http/hook.py
+++ b/platypush/message/event/http/hook.py
@@ -64,7 +64,9 @@ class WebhookEvent(Event):
         get_redis().rpush(self.args['response_queue'], output)
 
     def wait_response(self, timeout=None):
-        return get_redis().blpop(self.args['response_queue'], timeout=timeout)[1]
+        rs = get_redis().blpop(self.args['response_queue'], timeout=timeout)
+        if rs and len(rs) > 1:
+            return rs[1]
 
 
 # vim:sw=4:ts=4:et: