Merge pull request #32315 from ahus1/fix_file_managed_http_requests

fixing file.managed with requests lib
This commit is contained in:
Mike Place 2016-04-04 11:20:11 -06:00
commit 4389680bc5

View File

@ -299,7 +299,16 @@ def query(url,
method, url, params=params, data=data, **req_kwargs
)
result.raise_for_status()
if stream is True or handle is True:
if stream is True:
# fake a HTTP response header
header_callback('HTTP/1.0 {0} MESSAGE'.format(result.status_code))
# fake streaming the content
streaming_callback(result.content)
return {
'handle': result,
}
if handle is True:
return {
'handle': result,
'body': result.content,