Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -333,6 +333,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
10 changes: 5 additions & 5 deletions samples/client/petstore/python/petstore_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )
10 changes: 5 additions & 5 deletions samples/openapi3/client/petstore/python/petstore_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def is_ipv4(target):
""" Test if IPv4 address or not
"""
try:
chk = ipaddress.IPv4Address(target)
return True
chk = ipaddress.IPv4Address(target)
return True
except ipaddress.AddressValueError:
return False
return False

def in_ipv4net(target, net):
""" Test if target belongs to given IPv4 network
Expand Down Expand Up @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None):

if is_ipv4(parsed.hostname):
for item in entries:
if in_ipv4net(parsed.hostname, item):
return True
if in_ipv4net(parsed.hostname, item):
return True
return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )