@@ -16,10 +16,7 @@ import ru.soune.nocopy.exception.NotValidFieldException;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -56,6 +53,7 @@ public class SearchImageService {
|
|||||||
.followRedirects(true)
|
.followRedirects(true)
|
||||||
.followSslRedirects(true)
|
.followSslRedirects(true)
|
||||||
.retryOnConnectionFailure(true)
|
.retryOnConnectionFailure(true)
|
||||||
|
.protocols(Arrays.asList(Protocol.HTTP_1_1))
|
||||||
// .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
|
// .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -67,6 +65,7 @@ public class SearchImageService {
|
|||||||
.followRedirects(true)
|
.followRedirects(true)
|
||||||
.followSslRedirects(true)
|
.followSslRedirects(true)
|
||||||
.retryOnConnectionFailure(true)
|
.retryOnConnectionFailure(true)
|
||||||
|
.protocols(Arrays.asList(Protocol.HTTP_1_1))
|
||||||
// .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
|
// .connectionPool(new ConnectionPool(0, 1, TimeUnit.NANOSECONDS))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -151,8 +150,8 @@ public class SearchImageService {
|
|||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.header("Accept", "*/*")
|
.header("Accept", "*/*")
|
||||||
.header("User-Agent", "curl/8.5.0")
|
// .header("User-Agent", "curl/8.5.0")
|
||||||
.header("Host", "www.searchapi.io")
|
// .header("Host", "www.searchapi.io")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|||||||
Reference in New Issue
Block a user