});
}); // requestLogData
+ describe('obscureAuthorizationHeader', function () {
+ it('obscures basic data', function () {
+ const authHeader = 'Basic Zm9vOmJhcg==';
+ const expected = 'Basic ************';
+ const result = common.obscureAuthorizationHeader(authHeader);
+ assert.strictEqual(result, expected);
+ });
+ it('obscures all of other types', function () {
+ const authHeader = 'someWeirdAuth';
+ const expected = '*************';
+ const result = common.obscureAuthorizationHeader(authHeader);
+ assert.strictEqual(result, expected);
+ });
+ it('does nothing when empty', function () {
+ const authHeader = undefined;
+ const expected = undefined;
+ const result = common.obscureAuthorizationHeader(authHeader);
+ assert.strictEqual(result, expected);
+ });
+ }); // obscureAuthorizationHeader
+
+ describe('scrubHeaderObject', function () {
+ it('', function () {
+ const data = {
+ headers: {
+ 'foo': 'bar',
+ 'authorization': 'Basic Zm9vOmJhcg==',
+ },
+ };
+ const expected = {
+ headers: {
+ 'foo': 'bar',
+ 'authorization': 'Basic ************',
+ },
+ };
+ common.scrubHeaderObject(data);
+ assert.deepStrictEqual(data, expected);
+ });
+ }); // scrubHeaderObject
+
describe('responseLogData', function () {
it('gives data', function () {
const res = {
});
}); // responseLogData
+ describe('handlerLogData', function () {
+ it('covers', function () {
+ const req = {
+ method: 'GET',
+ somethingElse: 'blah',
+ };
+ const res = {
+ getHeaders: () => ({}),
+ statusCode: 200,
+ blah: 'blah',
+ };
+ const ctx = {};
+ const result = common.handlerLogData(req, res, ctx);
+ assert.deepStrictEqual(result, {
+ req: {
+ method: 'GET',
+ },
+ res: {
+ headers: {},
+ statusCode: 200,
+ },
+ ctx: {},
+ });
+ });
+ }); // handlerLogData
+
describe('setOptions', function () {
it('sets options', function () {
const expected = {