Graylog2 / Graylog2/graylog2-server

Custom HTTP Notification appends charset=utf-8 to application/x-www-form-urlencoded causing incompatible requests

未关闭
#26,653 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug triaged
主要语言
Java
星标
8.1k
派生
1.1k
平均合并
1 天 21 小时
30 天内合并 PR
218

描述

### Environment

- Graylog: 6.0.12
- Notification type: Custom HTTP Notification

### Problem

Custom HTTP Notification always sends

```
Content-Type: application/x-www-form-urlencoded; charset=utf-8
```

instead of

```
Content-Type: application/x-www-form-urlencoded
```

The `charset=utf-8` cannot be removed or overridden.

### Target API

VK Teams Bot API

Endpoint:

```
https://myteam.mail.ru/bot/v1/messages/sendText
```

### Expected behavior

Graylog should send

```
Content-Type: application/x-www-form-urlencoded
```

without automatically appending charset.

### Actual behavior

Graylog sends

```
Content-Type: application/x-www-form-urlencoded; charset=utf-8
```

The request reaches the server, but VK Teams rejects or ignores it.

### Verification

The same request works correctly from:

- curl
- Postman

Example:

```
curl -X POST \
https://myteam.mail.ru/bot/v1/messages/sendText \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "token=..." \
--data-urlencode "chatId=..." \
--data-urlencode "text=test"
```

If

```
charset=utf-8
```

is added to Content-Type, the request no longer works.

This was verified using:

- curl
- Postman
- Webhook.site

Webhook.site confirms that Graylog correctly sends:

- POST
- x-www-form-urlencoded
- correct request body

The only visible difference is the automatically appended charset.

### Additional information

The Headers field cannot override the generated Content-Type header.

贡献指南

打开贡献指南

调研方向

从 Custom HTTP Notification 的实现开始,追踪其表单请求构建 Content-Type 标头的位置。针对 VK Teams 端点或 Webhook.site 重现该请求,然后验证已完成的请求使用不带 charset=utf-8 的 application/x-www-form-urlencoded,并且仍然理解 Headers 字段的行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
72/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。