apache / apache/servicecomb-java-chassis

[BUG] - http请求体开启了压缩之后,cse未能正确识别到

未关闭
#4,879 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Java
星标
1.9k
派生
814
平均合并
8 天 23 小时
30 天内合并 PR
1

描述

### Steps to Reproduce

1. 发送http请求,http header如下:
```
'Content-Encoding': 'gzip',
'Content-Type': 'application/json',
```
2. 请求发送到服务器端,未能正确先解压gzip,导致报错:
```
Parameter is [queryReq]. Processor is [body]. Message is [Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\r, \\n, \\t) is allowed between tokens\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]]."}
```
3. 只有尝试将http请求的header修改为如下的时候,才不会报错:
```
'Content-Encoding': 'gzip',
'Content-Type': 'application/gzip',
```
查找一些资料显示,Content-Type 表示标头用于指示资源的原始[媒体类型](https://developer.mozilla.org/zh-CN/docs/Glossary/MIME_type)(在发送时应用任何内容编码之前);写成`'Content-Type': 'application/gzip'`也不正确了,原始内容是json格式的body

### Expected Behavior

_No response_

### Servicecomb Version

_No response_

### Additional Context

_No response_

贡献指南

这个仓库没有索引到贡献指南

调研方向

该 issue 未指出源文件、测试或入口点。首先定位 HTTP 请求体处理和 Content-Encoding 处理,然后使用 gzip 重现 JSON 请求。完成标准是:带有 Content-Type application/json 的 gzip 编码 JSON 请求体在解析前被解压,且不会出现报告中的错误,并具备回归覆盖。

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

评估

技术栈
java
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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