elasticsearch/elasticsearch-py — pull request #8 by nkvoll (2013-10-01 21:51:40+00:00)
Title: Fix RequestsHttpConncetion HTTP Auth

Auth using the RequestsHttpConnection was broken with requests since neither session.send() does not add the auth object/tuple to the request.

Tests have been added to verify this, but the exact code path chosen depends on the version of Requests. On newer versions (2.0.0 and above, released 2013-09-24), the session provides a hook for us to prepare the request, but on earlier versions (1.2.3 and below), we have to take care of adding the auth ourselves since we want to prepare the request first, before sending, and those earlier versions of Requests only provide us with Session.send(), which does both.

Additionally, the constructor did not accept a list (of length 2) with the username and password similar to the Urllib3Connection. This has been fixed and tests have been added.