diff options
-rw-r--r-- | opnfv_testapi/resources/test_handlers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/opnfv_testapi/resources/test_handlers.py b/opnfv_testapi/resources/test_handlers.py index 36c4e8b..d4fc445 100644 --- a/opnfv_testapi/resources/test_handlers.py +++ b/opnfv_testapi/resources/test_handlers.py @@ -440,9 +440,13 @@ class TestsUploadDataHandler(GenericTestHandler): @raise 404: pod/project/testcase not exist @raise 400: body/pod_name/project_name/case_name not provided """ + token = self.get_secure_cookie("token") openid = self.request.headers._dict['Openid'] if openid: self.json_args['owner'] = openid + input_token = self.request.headers._dict['Token'] + if not input_token or not input_token == token: + raises.Unauthorized(message.invalid_token()) self._post() |