NettyResponse ignores multipart content type

吃可爱长大的小学妹 提交于 2019-12-11 10:37:41

问题


I use AsyncHttpClient with Netty provider to get response body. It works ok with most responses, the problem is with multipart ContentType. For example, this response:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37"; start="<root.message@cxf.apache.org>"; start-info="text/xml";charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 20 Mar 2015 13:09:50 GMT

--uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>

<soap:Envelope></soap:Envelope>

My client uses getResponseBody method. The return value is:

--uuid:2dfd79bd-bdd5-4e15-bf4a-d08b63918c37
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>

<soap:Envelope></soap:Envelope>

NettyResponse completely ignores the Content-Type: multipart/related header and wipes out the headers. Returned body still contains headers for individual parts of the response, without the information about the ContentType and boundary (it has already been stripped out).

Is it true that Netty lacks the support for multipart responses? Or am I missing something?

EDIT: There is a HTTP multipart support codec, but seems to be only for multipart requests, not responses.

来源:https://stackoverflow.com/questions/29171082/nettyresponse-ignores-multipart-content-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!