in reply to Re^3: Again on SOAP::Lite, MIME::Entity and SOAP::Packager
in thread Again on SOAP::Lite, MIME::Entity and SOAP::Packager

diff --git a/usr/local/share/perl5/MIME/Entity.pm b/usr/local/share/perl5/MIME/Entity.pm index 3006853..ddfeb6c 100644 --- a/usr/local/share/perl5/MIME/Entity.pm +++ b/usr/local/share/perl5/MIME/Entity.pm @@ -1828,9 +1828,9 @@ sub print_body { ### Parts: my $part; foreach $part ($self->parts) { - $out->print("--$boundary\n"); + $out->print("--$boundary\r\n"); $part->print($out); - $out->print("\n"); ### needed for next delim/clo +se + $out->print("\r\n"); ### needed for next delim/c +lose } $out->print("--$boundary--\n");

I confirm the "bug" is in the print_body sub of MIME::Entity, in the part where it adds boundaries string to the body. I'm sure with the proposed patch will work with apache axis but peraphs will broke compatibility with other systems. What to do in those cases? Should I open a bug request somewhere?

Replies are listed 'Best First'.
Re^5: Again on SOAP::Lite, MIME::Entity and SOAP::Packager
by Corion (Patriarch) on Dec 29, 2016 at 09:48 UTC

    I think a slightly more flexible approach would be to use $MIME::Entity::BOUNDARY_DELIMITER and set that to \r\n (if it's not set already). That way, people (still) using Apache Axis can configure their client to be compatible with that weird notion of line delimiters while the rest of the world can use \r\n as god intended.

    You can add that patch to rt://MIME::tools, possibly with a link back to this discussion and that other ticket mentioning the wrong kind of newlines being hardcoded. Even if the maintainer ignores that ticket+patch, at least others can find it there and apply it locally.

      Here is the RT request:

      https://rt.cpan.org/Public/Bug/Display.html?id=119568

      Even if I successfully patched the module, I'm still convinced that I should monkey patch or extend it until I have an "official" resolution of the bug. Run a modified module breaks portability and updates, and I don't want to ship an additional file with my code. I ll retry with your solution in comment #3