update python auth to skip empty token/username,password

This commit is contained in:
wing328
2015-11-20 17:01:21 +08:00
parent 5c50e08965
commit 271661aec7
7 changed files with 68 additions and 30 deletions

View File

@@ -453,7 +453,9 @@ class ApiClient(object):
for auth in auth_settings:
auth_setting = config.auth_settings().get(auth)
if auth_setting:
if auth_setting['in'] == 'header':
if not auth_setting['value']:
continue
elif auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':
querys[auth_setting['key']] = auth_setting['value']