You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ti...@apache.org on 2024/05/10 17:54:41 UTC
(incubator-kie-tools) branch main updated: NO-ISSUE: Fix extended-services URL on kie-sandbox (#2313)
This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new f675085ebce NO-ISSUE: Fix extended-services URL on kie-sandbox (#2313)
f675085ebce is described below
commit f675085ebcefa75d81a97f4523fbe7d44f679634
Author: Thiago Lugli <th...@users.noreply.github.com>
AuthorDate: Fri May 10 14:54:36 2024 -0300
NO-ISSUE: Fix extended-services URL on kie-sandbox (#2313)
---
packages/online-editor/env/index.js | 2 +-
packages/online-editor/src/settings/SettingsContext.tsx | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/packages/online-editor/env/index.js b/packages/online-editor/env/index.js
index 1287d0fa621..248c357ac91 100644
--- a/packages/online-editor/env/index.js
+++ b/packages/online-editor/env/index.js
@@ -62,7 +62,7 @@ module.exports = composeEnv(
description: "CORS Proxy URL.",
},
ONLINE_EDITOR__extendedServicesUrl: {
- default: `http://${extendedServicesEnv.env.extendedServices.host}:${extendedServicesEnv.env.extendedServices.port}`,
+ default: `http://${extendedServicesEnv.env.extendedServices.ip}:${extendedServicesEnv.env.extendedServices.port}`,
description: "Extended Services URL.",
},
ONLINE_EDITOR__requireCustomCommitMessage: {
diff --git a/packages/online-editor/src/settings/SettingsContext.tsx b/packages/online-editor/src/settings/SettingsContext.tsx
index 6feaabfa92c..d9b58c0658a 100644
--- a/packages/online-editor/src/settings/SettingsContext.tsx
+++ b/packages/online-editor/src/settings/SettingsContext.tsx
@@ -143,7 +143,10 @@ export function SettingsContextProvider(props: PropsWithChildren<{}>) {
}
const envExtendedServicesUrl = new URL(env.KIE_SANDBOX_EXTENDED_SERVICES_URL);
- const envExtendedServicesHost = `${envExtendedServicesUrl.protocol}//${envExtendedServicesUrl.hostname}`;
+ // 0.0.0.0 is "equivalent" to localhost, but browsers don't like having mixed http/https urls with the exception of localhost
+ const envExtendedServicesHost = `${envExtendedServicesUrl.protocol}//${
+ envExtendedServicesUrl.hostname === "0.0.0.0" ? "localhost" : envExtendedServicesUrl.hostname
+ }`;
const envExtendedServicesPort = envExtendedServicesUrl.port;
await persistSettings({
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org