Content-Encoding header is set to deflated instead of identity when skip_compression rule is present as part of options.rules but not options itself. This is not the expected result according to the logger API.
Expected behavior
let logger = new HttpLogger({url: 'http://localhost:7701/message', rules: 'include debug\n\nskip_compression'});
console.log(logger._url_options.headers);
//{
// 'Content-Encoding': 'identity',
// 'Content-Type': 'application/json; charset=UTF-8',
// 'User-Agent': 'Resurface/2.2.1 (http_logger.js)'
//}
Current behavior
let logger = new HttpLogger({url: 'http://localhost:7701/message', rules: 'include debug\n\nskip_compression'});
console.log(logger._url_options.headers);
//{
// 'Content-Encoding': 'deflate',
// 'Content-Type': 'application/json; charset=UTF-8',
// 'User-Agent': 'Resurface/2.2.1 (http_logger.js)'
//}
How to reproduce?
const { HttpLogger } = require('resurfaceio-logger');
let logger = new HttpLogger({url: 'http://localhost:7701/message', rules: 'include debug\n\nskip_compression'});
assert.equal(logger.skip_compression, true);
assert.equal(logger._url_options.headers['Content-Encoding'], 'identity'); // fails
The header can also be inspected with a packet capture tool like wireshark, or an HTTP proxy.
Content-Encodingheader is set todeflatedinstead ofidentitywhenskip_compressionrule is present as part ofoptions.rulesbut notoptionsitself. This is not the expected result according to the logger API.Expected behavior
Current behavior
How to reproduce?
The header can also be inspected with a packet capture tool like wireshark, or an HTTP proxy.