Skip to content

Commit

Permalink
Add user-agent header when connecting to vsphere
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhao He committed Nov 19, 2016
1 parent 1f9c6a6 commit 5ddbb49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyVmomi/SoapAdapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,8 @@ def InvokeMethod(self, mo, info, args, outerStub=None):

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)
Expand Down

0 comments on commit 5ddbb49

Please sign in to comment.