Skip to content

Commit 5db8466

Browse files
fix: Disable OkHttp read timeout to prevent premature timeouts
1 parent 13a33cb commit 5db8466

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/com/scanoss/rest/ScanApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ private ScanApi(String scanType, Duration timeout, Integer retryLimit, String ur
9999
}
100100
if (okHttpClient == null) {
101101
OkHttpClient.Builder okBuilder = new OkHttpClient.Builder();
102-
okBuilder.callTimeout(this.timeout); // Set default timeout
102+
okBuilder.callTimeout(this.timeout); // Set default call timeout
103+
okBuilder.readTimeout(Duration.ZERO); // No read timeout; overall request is bounded by callTimeout
103104
// Build the HTTP client with a custom certificate (ignoring hostname verification)
104105
if (customCert != null && ! customCert.isEmpty()) {
105106
HandshakeCertificates certificates = new HandshakeCertificates.Builder()

0 commit comments

Comments
 (0)