apache / apache/servicecomb-java-chassis
有办法修改响应头的content-type属性吗
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
在 common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java 中
处理响应体Content-Type属性的方法是通过拼接produceProcessor的getName()方法返回的值和"; charset=utf-8"字符串实现的,但如果我需要设置其他charset,甚至添加boundary属性,应该怎么做?
``` java
responseEx.setContentType(produceProcessor.getName() + "; charset=utf-8");
```
比如我某个契约需要:
Content-Type: multipart/form-data; boundary=----------------------
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java at the responseEx.setContentType call, then trace produceProcessor.getName() and the response handling around it. Determine how response media-type parameters are represented and where existing REST tests cover this path. Done means callers can produce the requested charset and boundary parameters instead of always receiving charset=utf-8.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100