On SSLObject.write method, added assert that data has content. This avoid to rise ssl.SSLEOFError on petition that has no content on response.

This commit is contained in:
Cesar Hoyos 2019-12-20 12:14:16 +01:00
parent b0d4949f1f
commit b45df84357
1 changed files with 4 additions and 1 deletions

View File

@ -894,7 +894,10 @@ class SSLObject:
The 'data' argument must support the buffer interface.
"""
return self._sslobj.write(data)
if data != b'':
return self._sslobj.write(data)
else:
return ""
def getpeercert(self, binary_form=False):
"""Returns a formatted version of the data in the certificate provided