mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
ensure streaming mode (use for example by file.managed) will works for requests backend
This commit is contained in:
parent
664043d7e7
commit
a867d23383
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user