diff --git a/x-pack/plugins/reporting/server/config/schema.test.ts b/x-pack/plugins/reporting/server/config/schema.test.ts index ddd5491b661bc4..69e4d443cf0402 100644 --- a/x-pack/plugins/reporting/server/config/schema.test.ts +++ b/x-pack/plugins/reporting/server/config/schema.test.ts @@ -126,6 +126,34 @@ describe('Reporting Config Schema', () => { ).toMatchObject({ hostname: 'Frodo' }); }); + it('allows setting a wildcard for chrome proxy bypass', () => { + expect( + ConfigSchema.validate({ + capture: { + browser: { + chromium: { + proxy: { + enabled: true, + server: 'http://example.com:8080', + bypass: ['*.example.com', '*bar.example.com', 'bats.example.com'], + }, + }, + }, + }, + }).capture.browser.chromium.proxy + ).toMatchInlineSnapshot(` + Object { + "bypass": Array [ + "*.example.com", + "*bar.example.com", + "bats.example.com", + ], + "enabled": true, + "server": "http://example.com:8080", + } + `); + }); + it(`logs the proper validation messages`, () => { // kibanaServer const throwValidationErr = () => ConfigSchema.validate({ kibanaServer: { hostname: '0' } }); diff --git a/x-pack/plugins/reporting/server/config/schema.ts b/x-pack/plugins/reporting/server/config/schema.ts index 2f77aff0020d53..33249f20757e27 100644 --- a/x-pack/plugins/reporting/server/config/schema.ts +++ b/x-pack/plugins/reporting/server/config/schema.ts @@ -97,7 +97,7 @@ const CaptureSchema = schema.object({ bypass: schema.conditional( schema.siblingRef('enabled'), true, - schema.arrayOf(schema.string({ hostname: true })), + schema.arrayOf(schema.string()), schema.maybe(schema.never()) ), }),