-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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'); // failsThe header can also be inspected with a packet capture tool like wireshark, or an HTTP proxy.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working