[Httplib2-discuss] Digest authentication buglet?
Status: Beta
Brought to you by:
jcgregorio
From: Manuzhai <man...@gm...> - 2007-01-18 13:28:49
|
Hello there, I've been using httplib2 for some things, and it's really nice. I used to use mechanize and it's derivative mechanoid, and httplib2 feels much better to me. One thing I would like is a cookie store in the Http-objects though: so I can really conduct a browser-like session. The reason I'm writing this email, though, is that I was wondering about something I walked up against today while trying to authenticate against the NewsGator REST API. It supports Digest authentication, but when GETting a response with the DigestAuthentication thing on it, it returns neither a Authentication-Info nor a WWW-Authenticate header. I quickly skimmed the RFC, and it seems this behavior is allowed. However, the DigestAuthentication.response() method, when no Authentication-Info header is present, tries to parse the WWW-Authenticate header, which is not actually there (since we've already authenticated). Therefore, an Exception occurs in DigestAuthentication.response()... >>> h, rsp = http.request(URL, headers = head) Traceback (most recent call last): File "<stdin>", line 1, in ? File "build/bdist.linux-i686/egg/httplib2/__init__.py", line 764, in request File "build/bdist.linux-i686/egg/httplib2/__init__.py", line 616, in _request File "build/bdist.linux-i686/egg/httplib2/__init__.py", line 359, in response KeyError: 'digest' I hope this can be fixed. If httplib2's behavior is right, I'll gladly complain to the NewsGator team, but for now it seems this is a problem with httplib2. Regards, Manuzhai |