GitHub user michaelperel opened a pull request:
https://github.com/apache/libcloud/pull/1231
Fixed upload/download streams
## Azure Driver upload_object_via_stream and download_object_as_stream fix
### Description
When trying to use upload_object_via_stream method, without this fix, a
403 error would be raised because of incorrect headers regarding content
length. This PR fixes it by setting the object size to the blob size.
When trying to use download_object_as_stream, while consuming the
result, a TypeError is thrown. This error surfaces because response.response
is not an iterator, unlike response.iter_content.
### Status
done, ready for review
### Checklist (tick everything that applies)
- [x] [Code
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
(required, can be done after the PR checks)
- [ ] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ]
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
(required for bigger changes)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/CatalystCode/libcloud azure_stream_fixes
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/1231.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1231
----
commit d82df98fd35e1f09cfac4765361c990a7abfaafb
Author: Michael Perel <michaelsethperel@...>
Date: 2018-08-02T17:29:46Z
Fixed upload/download streams
----
---