Akka-http: Respect Content-Transfer-Encoding in BodyPartParser

Created on 8 Sep 2016  路  8Comments  路  Source: akka/akka-http

Issue by kswmsw
_Monday Feb 23, 2015 at 17:15 GMT_
_Originally opened as https://github.com/akka/akka/issues/16921_


akka.http.engine.parsing.BodyPartParser in akka-http-core-experimental 1.0-M3 ignores the Content-Transfer-Encoding header when parsing the entity. This means that currently if a client uploads a body part with Content-Transfer-Encoding quoted-printable or base64, the wrong data is passed to the application with no error or warning.

Instead, Akka should respect this header, and use its value to decode the bytes of the incoming stream when constructing the bytes of the body part. The dataBytes of the parsed body part should be the decoded bytes of the body part, not the raw bytes of the multipart entity.

The relevant standards are RFC2046 section 5.1 and RFC2045 section 6. According to these, each part of a multipart entity may have a Content-Transfer-Encoding. If this has value quoted-printable or base64, then the content of the body part has been encoded with the named encoding. If it is 7bit, 8bit, binary, or omitted, then no encoding has been applied.

Apache Commons has Base64 and QuotedPrintableCodec which may be applicable in an implementation.

help wanted 1 - triaged nice-to-have (low-prio)

Most helpful comment

+1

All 8 comments

Comment by sirthias
_Wednesday Mar 04, 2015 at 10:38 GMT_


Thanks for this nice ticket description and the references to the relevant RFCs!

/cc @jrudolph

Comment by kswmsw
_Wednesday Mar 04, 2015 at 11:02 GMT_


:-) thanks!

Comment by kswmsw
_Friday Mar 27, 2015 at 17:03 GMT_


Hi, can you give me an idea of where this is in your queue? Thanks.

Comment by sirthias
_Monday Mar 30, 2015 at 07:51 GMT_


Unfortunately this is not on our high-priority list at the moment.
There are quite a few tickets that likely affect more users and are thus more crucial to get done ASAP.

Comment by kswmsw
_Monday Mar 30, 2015 at 08:43 GMT_


That's fine, thanks for letting me know. I appreciate all the great work you do.

Comment by ktoso
_Tuesday Oct 20, 2015 at 10:24 GMT_


Moving to 1.x, sounds like we should do it however it's not urgent.

Comment by kswmsw
_Tuesday Oct 20, 2015 at 10:29 GMT_


Thanks.

+1

Was this page helpful?
0 / 5 - 0 ratings