Skip to content

Commit c37e2dd

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

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ private ScanApi(String scanType, Duration timeout, Integer retryLimit, String ur
100100
if (okHttpClient == null) {
101101
OkHttpClient.Builder okBuilder = new OkHttpClient.Builder();
102102
okBuilder.callTimeout(this.timeout); // Set default 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)