Handle 301s 'properly'.
Cleanup the redirect if blocks.
Fix hangs on streaming uploads with HTTPDigestAuth

When using Digest Authentication, the client resends the same request
after the server responds with the 401 "Unauthorized". However, when
doing streaming uploads, it gets stuck because the body data (a
file-like object) is already consumed at the initial request.

The patch fixes this by rewinding the file-like object before
resending the request.
Merge pull request #1754 from Lukasa/verb_change

Match the HTTPbis on HTTP 301.
Merge pull request #1760 from akitada/fix-hangs-on-streaming-uploads

Fix hangs on streaming uploads with HTTPDigestAuth