We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d780200 commit 6799a85Copy full SHA for 6799a85
test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java
@@ -126,10 +126,11 @@ public void setContentLength(int contentLength) {
126
}
127
128
public void setContentLength(HttpBody body) {
129
- if (body.isEmpty() || body instanceof HttpBody.NoopStream) {
130
- setContentLength(0);
131
- } else if (body.isFull()) {
132
- setContentLength(body.asFull().bytes().length());
+ if (body.isFull()) {
+ var len = body.asFull().bytes().length();
+ if (len > 0) {
+ setContentLength(body.asFull().bytes().length());
133
+ }
134
135
136
0 commit comments