Skip to content

Commit

Permalink
[PDI-15706] fixed HTTPPOST RequestEntity wrong length
Browse files Browse the repository at this point in the history
  • Loading branch information
gyk001 committed Oct 9, 2016
1 parent bf28d74 commit 3d3becf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions engine/src/org/pentaho/di/trans/steps/httppost/HTTPPOST.java
Expand Up @@ -186,13 +186,13 @@ private Object[] callHTTPPOST( Object[] rowData ) throws KettleException {
fis = new FileInputStream( input );
post.setRequestEntity( new InputStreamRequestEntity( fis, input.length() ) );
} else {
byte[] bytes;
if ( ( data.realEncoding != null ) && ( data.realEncoding.length() > 0 ) ) {
post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( tmp
.getBytes( data.realEncoding ) ), tmp.length() ) );
bytes = tmp.getBytes( data.realEncoding );
} else {
post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( tmp.getBytes() ), tmp
.length() ) );
bytes = tmp.getBytes();
}
post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( bytes, bytes.length );
}
}

Expand Down

0 comments on commit 3d3becf

Please sign in to comment.