mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #32315 from ahus1/fix_file_managed_http_requests
fixing file.managed with requests lib
This commit is contained in:
commit
4389680bc5
@ -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