This is an automated email from the ASF dual-hosted git repository.

gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bc72c637 [bugfix] fix HTTP API bug #1895 (#1909)
7bc72c637 is described below

commit 7bc72c637eb34a1d6af5c273b5c30ddb259df604
Author: aias00 <[email protected]>
AuthorDate: Sat May 4 11:07:14 2024 +0800

    [bugfix] fix HTTP API bug #1895 (#1909)
---
 .../org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java
 
b/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java
index 62f39fa22..6194cfeb6 100644
--- 
a/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java
+++ 
b/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java
@@ -199,8 +199,8 @@ public class HttpCollectImpl extends AbstractCollect {
         HttpProtocol httpProtocol = metrics.getHttp();
         String url = httpProtocol.getUrl();
         
-        if (StringUtils.hasText(url) || !url.startsWith(RIGHT_DASH)) {
-            httpProtocol.setUrl(url == null ? RIGHT_DASH : RIGHT_DASH + 
url.trim());
+        if (!StringUtils.hasText(url) || !url.startsWith(RIGHT_DASH)) {
+            httpProtocol.setUrl(StringUtils.hasText(url) ? RIGHT_DASH + 
url.trim() : RIGHT_DASH);
         }
         
         if (CollectionUtils.isEmpty(httpProtocol.getSuccessCodes())) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to