Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cookie.py 679B

1234567891011121314151617181920212223
  1. from http import cookies
  2. # For backwards compatibility in Django 2.1.
  3. SimpleCookie = cookies.SimpleCookie
  4. def parse_cookie(cookie):
  5. """
  6. Return a dictionary parsed from a `Cookie:` header string.
  7. """
  8. cookiedict = {}
  9. for chunk in cookie.split(";"):
  10. if "=" in chunk:
  11. key, val = chunk.split("=", 1)
  12. else:
  13. # Assume an empty name per
  14. # https://bugzilla.mozilla.org/show_bug.cgi?id=169091
  15. key, val = "", chunk
  16. key, val = key.strip(), val.strip()
  17. if key or val:
  18. # unquote using Python's algorithm.
  19. cookiedict[key] = cookies._unquote(val)
  20. return cookiedict