Skip to content

Commit 286d976

Browse files
committed
fix(ort-utils): Set the body size to -1 when not sending any body
This is part of a `SocketTimeoutException` fix when running with Java 25. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.io>
1 parent 6aa1704 commit 286d976

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

utils/ort/src/funTest/kotlin/storage/HttpFileStorageFunTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class HttpFileStorageFunTest : WordSpec() {
4646
when (exchange.requestMethod) {
4747
"PUT" -> {
4848
requests[exchange.requestURI.toString()] = exchange.requestBody.reader().use { it.readText() }
49-
exchange.sendResponseHeaders(HttpURLConnection.HTTP_CREATED, 0)
49+
exchange.sendResponseHeaders(HttpURLConnection.HTTP_CREATED, -1)
5050
}
5151

5252
"GET" -> {
@@ -55,7 +55,7 @@ class HttpFileStorageFunTest : WordSpec() {
5555
exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0)
5656
exchange.responseBody.writer().use { it.write(data) }
5757
} else {
58-
exchange.sendResponseHeaders(HttpURLConnection.HTTP_NOT_FOUND, 0)
58+
exchange.sendResponseHeaders(HttpURLConnection.HTTP_NOT_FOUND, -1)
5959
}
6060
}
6161
}

utils/ort/src/funTest/kotlin/storage/S3FileStorageFunTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class S3FileStorageFunTest : WordSpec() {
6060
"PUT" -> {
6161
val key = exchange.requestURI.toString().removePrefix("/$bucket/")
6262
requests[key] = exchange.requestBody.reader().use { it.readText() }.split('\n')[1].trimEnd()
63-
exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0)
63+
exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, -1)
6464
}
6565

6666
"GET" -> {

0 commit comments

Comments
 (0)