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 70af0669c [bugfix] Only POST and PUT methods carry payload (#2302)
70af0669c is described below
commit 70af0669c6b80635f9ba2b8151005e0bd8291613
Author: kangli <[email protected]>
AuthorDate: Fri Jul 19 16:53:29 2024 +0800
[bugfix] Only POST and PUT methods carry payload (#2302)
Co-authored-by: tomsun28 <[email protected]>
---
.../org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 193dd1a38..7264c8c9b 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
@@ -549,7 +549,7 @@ public class HttpCollectImpl extends AbstractCollect {
}
// if it has payload, would override post params
- if (StringUtils.hasLength(httpProtocol.getPayload())) {
+ if (StringUtils.hasLength(httpProtocol.getPayload()) &&
(HttpMethod.POST.matches(httpMethod) || HttpMethod.PUT.matches(httpMethod))) {
requestBuilder.setEntity(new
StringEntity(httpProtocol.getPayload(), StandardCharsets.UTF_8));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]