Fix for unhandled gunzip/zlib errors #528
This commit is contained in:
parent
6193f58dd2
commit
8a76df8884
@ -115,16 +115,16 @@ function handleCopyFrom (logger) {
|
||||
|
||||
req
|
||||
.on('data', data => isGzip ? metrics.addGzipSize(data.length) : undefined)
|
||||
.on('error', err => {
|
||||
metrics.end(null, err);
|
||||
pgstream.emit('error', err);
|
||||
})
|
||||
.on('close', () => {
|
||||
const err = new Error('Connection closed by client');
|
||||
pgstream.emit('cancelQuery', err);
|
||||
pgstream.emit('error', err);
|
||||
})
|
||||
.pipe(isGzip ? zlib.createGunzip() : new PassThrough())
|
||||
.on('error', err => {
|
||||
metrics.end(null, err);
|
||||
pgstream.emit('error', err);
|
||||
})
|
||||
.on('data', data => {
|
||||
metrics.addSize(data.length);
|
||||
|
||||
|
@ -203,7 +203,7 @@ describe('copy-endpoints', function() {
|
||||
assert.deepEqual(
|
||||
JSON.parse(res.body),
|
||||
{
|
||||
error:["Error while decompressing: incorrect header check"]
|
||||
error:["incorrect header check"]
|
||||
}
|
||||
);
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user