mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Handle potential ValueError when checking content length
This should never happen if the remote webserver is working properly, but I'm paranoid and want to cover this corner case.
This commit is contained in:
parent
a89c987943
commit
80b396db73
1 changed files with 2 additions and 2 deletions
|
@ -624,12 +624,12 @@ class Client(object):
|
|||
|
||||
try:
|
||||
content_length = int(query['handle'].headers['Content-Length'])
|
||||
except (AttributeError, KeyError):
|
||||
except (AttributeError, KeyError, ValueError):
|
||||
# Shouldn't happen but don't let this raise an exception.
|
||||
# Instead, just don't do content length checking below.
|
||||
log.warning(
|
||||
'No Content-Length header in HTTP response from fetch of '
|
||||
'{0}'.format(fixed_url)
|
||||
'{0}, or Content-Length is non-numeric'.format(fixed_url)
|
||||
)
|
||||
content_length = None
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue