Skip to content

Commit 704fa35

Browse files
don't compress body when calling clone()
1 parent 247805e commit 704fa35

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/HttpSender.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ public HttpPostCall(byte[] body) {
111111
}
112112

113113
public byte[] getBody() {
114-
return needsCompression() ? compress(this.body) : this.body;
114+
return getBody(true);
115+
}
116+
117+
public byte[] getBody(boolean compressIfNeeded) {
118+
return compressIfNeeded && needsCompression() ? compress(this.body) : this.body;
115119
}
116120

117121
public HttpHeaders getDefaultHeaders() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinRestTemplateSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private static class RestTemplateHttpPostCall extends HttpPostCall {
6161

6262
@Override
6363
public Call<Void> clone() {
64-
return new RestTemplateHttpPostCall(this.endpoint, getBody(), this.restTemplate);
64+
return new RestTemplateHttpPostCall(this.endpoint, getBody(false), this.restTemplate);
6565
}
6666

6767
@Override

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinWebClientSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static class WebClientHttpPostCall extends HttpPostCall {
5858

5959
@Override
6060
public Call<Void> clone() {
61-
return new WebClientHttpPostCall(this.endpoint, getBody(), this.webClient);
61+
return new WebClientHttpPostCall(this.endpoint, getBody(false), this.webClient);
6262
}
6363

6464
@Override

0 commit comments

Comments
 (0)