Open creabob opened 1 month ago
what?
in modifyResponse plugin, i add this conditions,
addKey success, but modify key failed .
当我修改返回值的header头时,content-type字段无法修改,无论是我自定义的插件还是modifyResponse插件,都不成功。
我修改的方式是加入这段代码
exchange.getResponse().getHeaders().setContentType(xxx)
当我debug时,发现content-type有单独的方法去获取,可是并不是通过exchange的值获取。
我想问,正确修改response的content-type方式是什么?
Is there an existing issue for this?
Current Behavior
in this case, HTTP return json data, I want to change to the return format of XML, but the Content-Type cannot be modified.
Expected Behavior
i can change the response header in exchange,
exchange.getResponse().getHeaders().setContentType(xxx)
Steps To Reproduce
modify the body and header of response. return changed body but the content-type of response header un-changed
Environment
Debug logs
No response
Anything else?
content-type use single method to require, However, it is not obtained from exchange but from Attribute,
when i add this line code ,it can fix ,is it correct?