Skip to content

Commit 146d5e7

Browse files
[Interactive setup] Removed default port from cluster address form (elastic#230582)
## Summary Removed default port from interactive setup cluster address form, unless it is specified by the user. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Fixes: https://github.com/elastic/kibana/issues/221043__ ## Release note Removed default port from interactive setup cluster address form, unless it is specified by the user.
1 parent 7e82853 commit 146d5e7

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/platform/plugins/private/interactive_setup/public/cluster_address_form.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('ClusterAddressForm', () => {
4141
await waitFor(() => {
4242
expect(coreStart.http.post).toHaveBeenLastCalledWith('/internal/interactive_setup/ping', {
4343
body: JSON.stringify({
44-
host: 'https://localhost:9200',
44+
host: 'https://localhost',
4545
}),
4646
});
4747
expect(onSuccess).toHaveBeenCalled();

src/platform/plugins/private/interactive_setup/public/cluster_address_form.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ export const ClusterAddressForm: FunctionComponent<ClusterAddressFormProps> = ({
7474
},
7575
onSubmit: async (values) => {
7676
const url = new URL(values.host);
77-
const host = `${url.protocol}//${url.hostname}:${url.port || 9200}`;
7877

7978
const result = await http.post<PingResult>('/internal/interactive_setup/ping', {
80-
body: JSON.stringify({ host }),
79+
body: JSON.stringify({ host: url.origin }),
8180
});
8281

83-
onSuccess?.(result, { host });
82+
onSuccess?.(result, { host: url.origin });
8483
},
8584
});
8685

0 commit comments

Comments
 (0)