diff --git a/platypush/backend/http/app/routes/hook.py b/platypush/backend/http/app/routes/hook.py index 871d2a9973..dcc385cc71 100644 --- a/platypush/backend/http/app/routes/hook.py +++ b/platypush/backend/http/app/routes/hook.py @@ -26,6 +26,7 @@ def _hook(hook_name): 'method': request.method, 'args': dict(request.args or {}), 'data': request.data.decode(), + 'headers': request.headers, } if event_args['data']: diff --git a/platypush/message/event/http/hook.py b/platypush/message/event/http/hook.py index 1b843067ad..b423e844f6 100644 --- a/platypush/message/event/http/hook.py +++ b/platypush/message/event/http/hook.py @@ -5,7 +5,7 @@ class WebhookEvent(Event): Event triggered when a custom webhook is called. """ - def __init__(self, hook, method, data=None, args=None, *argv, **kwargs): + def __init__(self, *argv, hook, method, data=None, args=None, headers=None, **kwargs): """ :param hook: Name of the invoked web hook, from http://host:port/hook/ :type hook: str @@ -18,10 +18,13 @@ class WebhookEvent(Event): :param args: Extra query string arguments :type args: dict + + :param headers: Request headers + :type args: dict """ - super().__init__(hook=hook, method=method, data=data, args=args or {}, *argv, **kwargs) + super().__init__(hook=hook, method=method, data=data, args=args or {}, + headers=headers or {}, *argv, **kwargs) # vim:sw=4:ts=4:et: -