Add support for preamble and epilogue in multipart entities#427
Conversation
6c8e153 to
d487b1e
Compare
| switch (modeCopy) { | ||
| case LEGACY: | ||
| form = new LegacyMultipart(charsetCopy, boundaryCopy, multipartPartsCopy); | ||
| form = new LegacyMultipart(charsetCopy, boundaryCopy, multipartPartsCopy, preamble, epilogue); |
There was a problem hiding this comment.
@arturobernalg Looks good to me. I would not add preamble and epilogue in the LEGACY mode, though.
|
Is this one addressing https://issues.apache.org/jira/browse/HTTPCLIENT-2064? |
Previously, multipart entities did not support adding a preamble or epilogue to the message. This commit adds support for these features by modifying the AbstractMultipartFormat class to accept preamble and epilogue strings in its constructor. The HttpRFC6532Multipart, HttpRFC7578Multipart, and HttpStrictMultipart classes are updated to pass these parameters to the parent constructor when creating instances of multipart entities. This change allows users to include custom content at the beginning and end of their multipart messages, which can be useful in certain scenarios such as adding metadata or information about the message contents.
f44f11e to
b06b7a9
Compare
ok2c
left a comment
There was a problem hiding this comment.
@michael-o Does the change-set meet your expectations?
Yes, it does. But no testing valid input according to RFC. But I guess that is: shit in, shit out. |
Hey @michael-o |
No, this change is fine. Everything else I have mentioned here is beyond this PR. |
This pull request adds support for preamble and epilogue in multipart entities for the Apache HttpComponents project. The
AbstractMultipartFormatclass has been updated to includepreambleandepilogueas additional parameters in the constructor. TheHttpRFC6532Multipart,HttpRFC7578Multipart, andHttpStrictMultipartclasses have also been updated to support these parameters in their constructors.Please let me know if there are any concerns or suggestions. Thank you!