From e1ead3c25fdc4cf7cff57d70c2d4f0141e6bbe48 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 8 Jul 2018 22:00:28 +0200 Subject: [PATCH] s/_token/token/ --- platypush/backend/http/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 2977a0b7..4b77ccd7 100644 --- a/platypush/backend/http/__init__.py +++ b/platypush/backend/http/__init__.py @@ -46,7 +46,7 @@ class HttpBackend(Backend): Note that if you set up a main token, it will be required for any HTTP interaction - either as ``X-Token`` HTTP header, on the query string (attribute name: ``token``), as part of the JSON payload root (attribute - name: ``_token``), or via HTTP basic auth (any username works). + name: ``token``), or via HTTP basic auth (any username works). Requires: @@ -201,7 +201,7 @@ class HttpBackend(Backend): else: try: args = json.loads(http_request.data.decode('utf-8')) - user_token = args.get('_token') + user_token = args.get('token') except: pass @@ -222,12 +222,8 @@ class HttpBackend(Backend): @app.route('/execute', methods=['POST']) def execute(): """ Endpoint to execute commands """ - args = json.loads(http_request.data.decode('utf-8')) if not self._authentication_ok(): return self._authenticate() - if '_token' in args: - del args['_token'] - args = json.loads(http_request.data.decode('utf-8')) msg = Message.build(args) self.logger.info('Received message on the HTTP backend: {}'.format(msg))