mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +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
1 changed files with 10 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue