Skip to content

Commit 7053ae1

Browse files
committed
No body request handling
1 parent 6c2dc06 commit 7053ae1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- No body request handling in `SocketUtils.ServerCallable`, by @HardNorth
46

57
## [0.0.11]
68
### Fixed

src/main/java/com/epam/reportportal/util/test/SocketUtils.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ public List<String> call() throws Exception {
8080
if (headers.isEmpty()) {
8181
throw new IOException("No headers received from client");
8282
}
83-
int lengthIdx =
84-
headers.indexOf(CONTENT_LENGTH_HEADER) + CONTENT_LENGTH_HEADER.length(); // Find the Content-Length header
85-
int contentLength = Integer.parseInt(headers.substring(lengthIdx, headers.indexOf(System.lineSeparator(), lengthIdx))
86-
.trim());
83+
84+
int contentLength = 0;
85+
int lengthIdx = headers.indexOf(CONTENT_LENGTH_HEADER);
86+
if (lengthIdx > 0) {
87+
lengthIdx += CONTENT_LENGTH_HEADER.length();
88+
contentLength = Integer.parseInt(headers.substring(lengthIdx, headers.indexOf(System.lineSeparator(), lengthIdx))
89+
.trim());
90+
}
8791
if (contentLength > 0) {
8892
char[] body = new char[contentLength];
8993
int actualRead = in.read(body, 0, contentLength);

0 commit comments

Comments
 (0)