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:
Joel Griffith 2020-08-10 16:07:12 -07:00 committed by GitHub
parent 4ee483be23
commit ae529879f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View file

@ -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' } });

View file

@ -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())
),
}),