diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 2977a0b7c..4b77ccd71 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))