Skip to content

Instantly share code, notes, and snippets.

@hugollm
Created April 9, 2017 17:17
Show Gist options
  • Save hugollm/8837d1bf40aeee7db23b9f89f731ae16 to your computer and use it in GitHub Desktop.
Save hugollm/8837d1bf40aeee7db23b9f89f731ae16 to your computer and use it in GitHub Desktop.
A bug that I found with python http.cookies.SimpleCookie
# watch -n 1 python3 -m unittest bug.py
from unittest import TestCase
from http.cookies import SimpleCookie
class BugTestCase(TestCase):
def test_bug(self):
morsel = list(SimpleCookie('token=abc; HttpOnly; SameSite=Strict').values())[0]
self.assertEqual(morsel.key, 'token')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment