apache / apache/servicecomb-java-chassis

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

Open
#4,879 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

### 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_

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source file, test, or entry point. Start by locating HTTP request-body handling and Content-Encoding processing, then reproduce the JSON request with gzip. Done means a gzip-encoded JSON body with Content-Type application/json is decompressed before parsing without the reported error, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.