Skip to content

Commit af47b60

Browse files
committed
Merge pull request #818 from tazmaniax/lighthouse-1889-patch
[#1889] WS call does not work in play-1.3.0RC2-12-g87e2d3c
2 parents 7fc2fd7 + 844cfed commit af47b60

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

framework/dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require: &allDependencies
1212
- cglib -> cglib-nodep 3.1
1313
- com.google.code.gson -> gson 2.2.4
1414
- com.jamonapi -> jamon 2.75
15-
- com.ning -> async-http-client 1.8.13
15+
- com.ning -> async-http-client 1.8.14
1616
- commons-beanutils 1.8.3
1717
- commons-codec 1.8
1818
- commons-collections 3.2.1
-518 KB
Binary file not shown.
518 KB
Binary file not shown.

framework/src/play/libs/ws/WSAsync.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,9 @@ private void checkFileBody(BoundRequestBuilder builder) {
494494
}
495495
}
496496
try {
497-
byte[] bodyBytes = sb.toString().getBytes( this.encoding );
498-
InputStream bodyInStream = new ByteArrayInputStream( bodyBytes );
499-
builder.setBody( bodyInStream );
500-
} catch ( UnsupportedEncodingException e) {
497+
byte[] bodyBytes = sb.toString().getBytes(this.encoding);
498+
builder.setBody(bodyBytes);
499+
} catch (UnsupportedEncodingException e) {
501500
throw new RuntimeException(e);
502501
}
503502

@@ -525,14 +524,13 @@ private void checkFileBody(BoundRequestBuilder builder) {
525524
if (this.parameters != null && !this.parameters.isEmpty()) {
526525
throw new RuntimeException("POST or PUT method with parameters AND body are not supported.");
527526
}
528-
if(this.body instanceof InputStream) {
527+
if (this.body instanceof InputStream) {
529528
builder.setBody((InputStream)this.body);
530529
} else {
531530
try {
532-
byte[] bodyBytes = this.body.toString().getBytes( this.encoding );
533-
InputStream bodyInStream = new ByteArrayInputStream( bodyBytes );
534-
builder.setBody( bodyInStream );
535-
} catch ( UnsupportedEncodingException e) {
531+
byte[] bodyBytes = this.body.toString().getBytes(this.encoding);
532+
builder.setBody(bodyBytes);
533+
} catch (UnsupportedEncodingException e) {
536534
throw new RuntimeException(e);
537535
}
538536
}

0 commit comments

Comments
 (0)