Skip to content

Commit

Permalink
Allow any hostname for chromium proxy bypass (#74693) (#74777)
Browse files Browse the repository at this point in the history
* Allow any hostname for chromium proxy bypass

* Adds a test for the proxy bypass config

* Add wildcard to test
  • Loading branch information
Joel Griffith authored Aug 12, 2020
1 parent 8180a38 commit 72a838e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions x-pack/plugins/reporting/server/config/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' } });
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/reporting/server/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
),
}),
Expand Down

0 comments on commit 72a838e

Please sign in to comment.