Allow any hostname for chromium proxy bypass (#74693)
* Allow any hostname for chromium proxy bypass * Adds a test for the proxy bypass config * Add wildcard to test
This commit is contained in:
parent
4ee483be23
commit
ae529879f2
|
@ -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' } });
|
||||
|
|
|
@ -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())
|
||||
),
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue