Skip to content

Commit 616b799

Browse files
[9.1] [Interactive setup] Removed default port from cluster address form (#230582) (#231308)
# Backport This will backport the following commits from `main` to `9.1`: - [[Interactive setup] Removed default port from cluster address form (#230582)](#230582) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Elena Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-08-11T13:31:10Z","message":"[Interactive setup] Removed default port from cluster address form (#230582)\n\n## Summary\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n__Fixes: https://github.com/elastic/kibana/issues/221043__\n\n## Release note\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.","sha":"146d5e7637c0e12ba8187093c35cf8e52cae0f89","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Security","Feature:Security/Interactive Setup","backport:prev-major","backport:current-major","v9.2.0"],"title":"[Interactive setup] Removed default port from cluster address form","number":230582,"url":"https://github.com/elastic/kibana/pull/230582","mergeCommit":{"message":"[Interactive setup] Removed default port from cluster address form (#230582)\n\n## Summary\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n__Fixes: https://github.com/elastic/kibana/issues/221043__\n\n## Release note\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.","sha":"146d5e7637c0e12ba8187093c35cf8e52cae0f89"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230582","number":230582,"mergeCommit":{"message":"[Interactive setup] Removed default port from cluster address form (#230582)\n\n## Summary\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.\n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n__Fixes: https://github.com/elastic/kibana/issues/221043__\n\n## Release note\n\nRemoved default port from interactive setup cluster address form, unless\nit is specified by the user.","sha":"146d5e7637c0e12ba8187093c35cf8e52cae0f89"}}]}] BACKPORT--> Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
1 parent 1e1a4b5 commit 616b799

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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)