Skip to content

Commit 03c5a8f

Browse files
author
Roland Hedberg
committed
Improved cookie handling
Added some logging lines
1 parent c9e9f71 commit 03c5a8f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/saml2/httpbase.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ def set_cookie(self, kaka, request):
154154
if morsel[attr]:
155155
if attr == "expires":
156156
std_attr[attr] = _since_epoch(morsel[attr])
157+
elif attr == "path":
158+
if morsel[attr].endswith(","):
159+
std_attr[attr] = morsel[attr][:-1]
160+
else:
161+
std_attr[attr] = morsel[attr]
157162
else:
158163
std_attr[attr] = morsel[attr]
159164
elif attr == "max-age":
@@ -204,6 +209,12 @@ def send(self, url, method="GET", **kwargs):
204209
_kwargs["auth"] = (self.user, self.passwd)
205210

206211
try:
212+
logger.debug("%s to %s" % (method, url))
213+
for arg in ["cookies", "data", "auth"]:
214+
try:
215+
logger.debug("%s: %s" % (arg.upper(), _kwargs[arg]))
216+
except KeyError:
217+
pass
207218
r = requests.request(method, url, **_kwargs)
208219
except requests.ConnectionError, exc:
209220
raise ConnectionError("%s" % exc)

0 commit comments

Comments
 (0)