Skip to content

Commit 8e0a84e

Browse files
committed
Fixed cookie load problem
1 parent 4e57ac3 commit 8e0a84e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

example/idp2/idp.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
import re
88
import time
99

10-
#from Cookie import SimpleCookie
1110
from hashlib import sha1
12-
#from urlparse import parse_qs
1311
from cherrypy import wsgiserver
14-
#from cherrypy.wsgiserver import ssl_pyopenssl
1512
from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter
1613
from future.backports.http.cookies import SimpleCookie
1714
from future.backports.urllib.parse import parse_qs
15+
from future.utils import PY3
1816

1917
from saml2 import BINDING_HTTP_ARTIFACT
2018
from saml2 import BINDING_URI
@@ -854,7 +852,12 @@ def do(self, query, binding, relay_state="", encrypt_cert=None):
854852
def info_from_cookie(kaka):
855853
logger.debug("KAKA: %s", kaka)
856854
if kaka:
857-
cookie_obj = SimpleCookie(kaka)
855+
cookie_obj = SimpleCookie()
856+
if PY3:
857+
import builtins
858+
cookie_obj.load(builtins.str(kaka))
859+
else:
860+
cookie_obj.load(str(kaka))
858861
morsel = cookie_obj.get("idpauthn", None)
859862
if morsel:
860863
try:

0 commit comments

Comments
 (0)