Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-7374

AttachmentSerializer misses an extra new line before the first attachment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.3
    • Fix Version/s: fuse-7.0
    • Component/s: CXF
    • Labels:
      None
    • Estimated Difficulty:
      Low
    • Sprint:
      Fuse 7.0 Sprint 19

      Description

      We had an old JIRA SF-481 and it fixed new lines between HTTP headers and the first attachment. But the fix was missing in JBoss Fuse 6.3.

      The AttachmentSerializer.java class is supposed to have this line
      writer.write("\r\n");
      to have an empty new line between HTTP headers and the first attachment element. i.e.

      150         message.put(Message.CONTENT_TYPE, ct.toString());
      151 
      152 
      153         // 2. write headers
      154         out = message.getContent(OutputStream.class);
      155         encoding = (String) message.get(Message.ENCODING);
      156         if (encoding == null) {
      157             encoding = StandardCharsets.UTF_8.name();
      158         }
      159         StringWriter writer = new StringWriter();
      +             writer.write("\r\n");
      160         writer.write("--");
      161         writer.write(bodyBoundary);
      162 
      163         StringBuilder mimeBodyCt = new StringBuilder();
      164         String bodyType = getHeaderValue("Content-Type", null);
      165         if (bodyType == null) {
      166             mimeBodyCt.append(xop ? "application/xop+xml" : bodyCt)
      167                 .append("; charset=").append(encoding);
      168             if (xop) {
      169                 mimeBodyCt.append("; type=\"").append(bodyCt);
      170                 if (bodyCtParamsEscaped != null) {
      171                     mimeBodyCt.append(bodyCtParamsEscaped);
      172                 }
      173                 mimeBodyCt.append("\"");
      

      But it was missing in 6.3.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ffang Freeman(Yue) Fang
                  Reporter:
                  joe.luo Joe Luo
                  Tester:
                  Viliam Kasala
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: