vmware / vmware/pyvmomi

SoapStubAdapter does not handle Set-Cookie header properly

Open
#98 3 comments 0 reactions 1 assignee View on GitHub

@tianhao64 is already working on this.

Since Dec 29, 2015.

bug VMware Staff Assist Needed
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

From a field report:

if [an] extension tries to generate its own cookie via:
Set-Cookie: you_are_doomed="Now"

then client library forgets vmware_soap_session cookie, and starts sending 'you_are_doomed="Now"' cookie instead (correct behavior is to start sending both of them), instantly invalidating your session:

Salient code is: SoapAdapter.py#L1213

      cookie = resp.getheader('set-cookie')
      status = resp.status

      if cookie:
         self.cookie = cookie

Where self is an instance of the class SoapStubAdapter which holds a copy of the SOAP session cookie inside itself. The correct behavior is to follow standard HTTP client session conventions and maintain whatever cookies the server sets for the session. To do otherwise invites the strange and spurious bugs at a possible later date.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.