mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-16 21:29:11 -07:00
Fix dangerous default args. (#29839)
This commit is contained in:
parent
5caa47feb9
commit
68aeaa58a8
50 changed files with 253 additions and 87 deletions
|
@ -670,10 +670,12 @@ class SSLValidationHandler(urllib_request.BaseHandler):
|
|||
to_add_path = None
|
||||
return (tmp_path, to_add_path, paths_checked)
|
||||
|
||||
def validate_proxy_response(self, response, valid_codes=[200]):
|
||||
def validate_proxy_response(self, response, valid_codes=None):
|
||||
'''
|
||||
make sure we get back a valid code from the proxy
|
||||
'''
|
||||
valid_codes = [200] if valid_codes is None else valid_codes
|
||||
|
||||
try:
|
||||
(http_version, resp_code, msg) = re.match(r'(HTTP/\d\.\d) (\d\d\d) (.*)', response).groups()
|
||||
if int(resp_code) not in valid_codes:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue