diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-08-27 10:58:50 +0200 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-08-27 10:58:50 +0200 |
commit | 03c5a8ffc76c2ae7c36c024d76296ab413e9c1ad (patch) | |
tree | 002d152c3122c0a0555785a7561835ec7670e283 /src/saml2/httpbase.py | |
parent | c9e9f718d6d972c457b7d83bf24a06390367911f (diff) | |
download | pysaml2-03c5a8ffc76c2ae7c36c024d76296ab413e9c1ad.tar.gz |
Improved cookie handling
Added some logging lines
Diffstat (limited to 'src/saml2/httpbase.py')
-rw-r--r-- | src/saml2/httpbase.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py index 16243a4a..38d792fe 100644 --- a/src/saml2/httpbase.py +++ b/src/saml2/httpbase.py @@ -154,6 +154,11 @@ class HTTPBase(object): if morsel[attr]: if attr == "expires": std_attr[attr] = _since_epoch(morsel[attr]) + elif attr == "path": + if morsel[attr].endswith(","): + std_attr[attr] = morsel[attr][:-1] + else: + std_attr[attr] = morsel[attr] else: std_attr[attr] = morsel[attr] elif attr == "max-age": @@ -204,6 +209,12 @@ class HTTPBase(object): _kwargs["auth"] = (self.user, self.passwd) try: + logger.debug("%s to %s" % (method, url)) + for arg in ["cookies", "data", "auth"]: + try: + logger.debug("%s: %s" % (arg.upper(), _kwargs[arg])) + except KeyError: + pass r = requests.request(method, url, **_kwargs) except requests.ConnectionError, exc: raise ConnectionError("%s" % exc) |