Handle compression for streams
This commit is contained in:
@ -96,7 +96,11 @@ class Transport {
|
||||
headers['Content-Type'] = 'application/json'
|
||||
|
||||
if (compression === 'gzip') {
|
||||
params.body = intoStream(params.body).pipe(createGzip())
|
||||
if (isStream(params.body) === false) {
|
||||
params.body = intoStream(params.body).pipe(createGzip())
|
||||
} else {
|
||||
params.body = params.body.pipe(createGzip())
|
||||
}
|
||||
headers['Content-Encoding'] = compression
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user