Merge pull request #484 from tianhao64/master

Add user-agent header when connecting to vsphere
This commit is contained in:
Tianhao He
2016-11-18 20:59:16 -08:00
committed by GitHub

View File

@@ -1312,7 +1312,8 @@ class SoapStubAdapter(SoapStubAdapterBase):
headers = {'Cookie' : self.cookie,
'SOAPAction' : self.versionId,
'Content-Type': 'text/xml; charset={0}'.format(XML_ENCODING)}
'Content-Type': 'text/xml; charset={0}'.format(XML_ENCODING),
'User-Agent' : 'pyvmomi'}
if self._acceptCompressedResponses:
headers['Accept-Encoding'] = 'gzip, deflate'
req = self.SerializeRequest(mo, info, args)