Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-15706

httppost requestEntity with wrong length when realEncoding is set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Urgent
    • Resolution: Fixed
    • Affects Version/s: 6.1.0 GA
    • Fix Version/s: 7.0.0 GA
    • Component/s: Step
    • Labels:
    • Story Points:
      0
    • PDI Sub-component:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      HTTPPOST.java line 190.

      tmp.length() is not equals to tmp.getBytes's length. so the entity will lose some data sometime.

      HTTPPOST.java
      
      if ( meta.isPostAFile() ) {
                File input = new File( tmp );
                fis = new FileInputStream( input );
                post.setRequestEntity( new InputStreamRequestEntity( fis, input.length() ) );
              } else {
                if ( ( data.realEncoding != null ) && ( data.realEncoding.length() > 0 ) ) {
                  post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( tmp
                      .getBytes( data.realEncoding ) ), tmp.length() ) );
                } else {
                  post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( tmp.getBytes() ), tmp
                      .length() ) );
                }
              }
      

        Attachments

          Activity

            People

            Assignee:
            eteixeira Emanuel Teixeira (Inactive)
            Reporter:
            gyk001 guoyukun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: