File tree Expand file tree Collapse file tree 6 files changed +21
-11
lines changed
modules/swagger-codegen/src/main/resources/python
petstore-security-test/python Expand file tree Collapse file tree 6 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -216,9 +216,12 @@ class Configuration(object):
216
216
217
217
:return: The token for basic HTTP authentication.
218
218
"""
219
- return urllib3.util.make_headers(
220
- basic_auth=self.username + ':' + self.password
221
- ).get('authorization')
219
+ token = ""
220
+ if self.username or self.password:
221
+ token = urllib3.util.make_headers(
222
+ basic_auth=self.username + ':' + self.password
223
+ ).get('authorization')
224
+ return token
222
225
223
226
def auth_settings(self):
224
227
"""Gets Auth Settings dict for api client.
Original file line number Diff line number Diff line change 1
- 2.4.9 -SNAPSHOT
1
+ 2.4.33 -SNAPSHOT
Original file line number Diff line number Diff line change @@ -214,9 +214,12 @@ def get_basic_auth_token(self):
214
214
215
215
:return: The token for basic HTTP authentication.
216
216
"""
217
- return urllib3 .util .make_headers (
218
- basic_auth = self .username + ':' + self .password
219
- ).get ('authorization' )
217
+ token = ""
218
+ if self .username or self .password :
219
+ token = urllib3 .util .make_headers (
220
+ basic_auth = self .username + ':' + self .password
221
+ ).get ('authorization' )
222
+ return token
220
223
221
224
def auth_settings (self ):
222
225
"""Gets Auth Settings dict for api client.
Original file line number Diff line number Diff line change 1
- 2.4.20 -SNAPSHOT
1
+ 2.4.33 -SNAPSHOT
Original file line number Diff line number Diff line change @@ -225,9 +225,12 @@ def get_basic_auth_token(self):
225
225
226
226
:return: The token for basic HTTP authentication.
227
227
"""
228
- return urllib3 .util .make_headers (
229
- basic_auth = self .username + ':' + self .password
230
- ).get ('authorization' )
228
+ token = ""
229
+ if self .username or self .password :
230
+ token = urllib3 .util .make_headers (
231
+ basic_auth = self .username + ':' + self .password
232
+ ).get ('authorization' )
233
+ return token
231
234
232
235
def auth_settings (self ):
233
236
"""Gets Auth Settings dict for api client.
Original file line number Diff line number Diff line change
1
+ # coding: utf-8
You can’t perform that action at this time.
0 commit comments