From 77b0967776f40050f20f4904284e070303247950 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Wed, 4 Feb 2026 12:41:20 -0400 Subject: [PATCH 1/3] Enhance URL validation in MakeHttpRequests trait to ensure a host is present. If the URL lacks a host, prepend the base URL from configuration or fallback to the app URL. --- ProcessMaker/Traits/MakeHttpRequests.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ProcessMaker/Traits/MakeHttpRequests.php b/ProcessMaker/Traits/MakeHttpRequests.php index 26da4cecd3..8f02e8f2f1 100644 --- a/ProcessMaker/Traits/MakeHttpRequests.php +++ b/ProcessMaker/Traits/MakeHttpRequests.php @@ -195,6 +195,12 @@ private function prepareRequestWithOutboundConfig(array $requestData, array &$co $method = $this->evalMustache($endpoint['method'], $requestData); $url = $this->addQueryStringsParamsToUrl($endpoint, $config, $requestData, $params); + // validate url have host + if (!parse_url($url, PHP_URL_HOST)) { + $host = $this->api_base_url ?? config('app.url'); + $url = $host . $url; + } + // Prepare Headers $headers = $this->addHeaders($endpoint, $config, $requestData); From ac52c1d68cd8c07f141890cad330915538630898 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Wed, 4 Feb 2026 12:55:03 -0400 Subject: [PATCH 2/3] change validation --- ProcessMaker/Traits/MakeHttpRequests.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ProcessMaker/Traits/MakeHttpRequests.php b/ProcessMaker/Traits/MakeHttpRequests.php index 8f02e8f2f1..e75d5013fd 100644 --- a/ProcessMaker/Traits/MakeHttpRequests.php +++ b/ProcessMaker/Traits/MakeHttpRequests.php @@ -195,12 +195,6 @@ private function prepareRequestWithOutboundConfig(array $requestData, array &$co $method = $this->evalMustache($endpoint['method'], $requestData); $url = $this->addQueryStringsParamsToUrl($endpoint, $config, $requestData, $params); - // validate url have host - if (!parse_url($url, PHP_URL_HOST)) { - $host = $this->api_base_url ?? config('app.url'); - $url = $host . $url; - } - // Prepare Headers $headers = $this->addHeaders($endpoint, $config, $requestData); @@ -489,6 +483,12 @@ private function addQueryStringsParamsToUrl($endpoint, array $config, array $dat $url = url($url); } + // validate url have host + if (!parse_url($url, PHP_URL_HOST)) { + $host = $this->api_base_url ?? config('app.url'); + $url = $host . $url; + } + // Evaluate mustache expressions in URL $url = $this->evalMustache($url, array_merge($data, $params)); // Add params from datasource configuration From c2ef4ae9e81501c15a4e750a07290a61c934d51e Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Wed, 4 Feb 2026 17:40:35 -0400 Subject: [PATCH 3/3] Enhance MakeHttpRequests trait to replace placeholder '{{__api_base_url__}}' with the actual API base URL, improving URL handling for HTTP requests. --- ProcessMaker/Traits/MakeHttpRequests.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ProcessMaker/Traits/MakeHttpRequests.php b/ProcessMaker/Traits/MakeHttpRequests.php index e75d5013fd..f38ed211e2 100644 --- a/ProcessMaker/Traits/MakeHttpRequests.php +++ b/ProcessMaker/Traits/MakeHttpRequests.php @@ -483,6 +483,10 @@ private function addQueryStringsParamsToUrl($endpoint, array $config, array $dat $url = url($url); } + if (strpos($url, '{{__api_base_url__}}') !== false) { + $url = str_replace('{{__api_base_url__}}', $this->api_base_url, $url); + } + // validate url have host if (!parse_url($url, PHP_URL_HOST)) { $host = $this->api_base_url ?? config('app.url');