gesomax / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

httplib2 raises an error with NTLM authentication #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

>>> import httplib2
>>> h = httplib2.Http()
>>> h.request('http://evolution.telligent.com/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "httplib2/__init__.py", line 1050, in request
    (response, content) = self._request(conn, authority, uri, request_uri,
method, body, headers, redirections, cachekey)
  File "httplib2/__init__.py", line 863, in _request
    for authorization in self._auth_from_challenge(host, request_uri,
headers, response, content):
  File "httplib2/__init__.py", line 798, in _auth_from_challenge
    challenges = _parse_www_authenticate(response, 'www-authenticate')
  File "httplib2/__init__.py", line 231, in _parse_www_authenticate
    (auth_scheme, the_rest) = authenticate.split(" ", 1)
ValueError: need more than 1 value to unpack

What is the expected output? What do you see instead?

It's expected that httplib2 doesn't authenticate, but return 401, since it
has no support for NTLM. Instead it crashes because the server sends
'WWW-Authenticate: NTLM' in headers, whereas the httplib2 code expects that
space character is in the header. I'm attaching a patch that makes the
error go away, but I'm not really sure of it's correctness. I'm mostly
reporting this bug to acknowledge that a bug exists.

What version of the product are you using? On what operating system?

httplib2 revision is 60c4e6c92e, using Ubuntu Jaunty.

Original issue reported on code.google.com by zelo.z...@gmail.com on 8 Sep 2009 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
Any chance python-nltm could be integrated to support this scenario?

Original comment by scottwa...@gmail.com on 7 Oct 2009 at 9:21

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 15 Feb 2011 at 4:46