Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security updates and timeout resolution #209

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.sdl.webapp.common.api.content.StaticContentNotLoadedException;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
Expand All @@ -23,8 +22,6 @@
@Profile("!cil.providers.active")
public class BinaryContentDownloader {

private static final Integer TIMEOUT_IN_MILLIS = 10000;

private final CloseableHttpClient httpclient;

@Autowired
Expand Down Expand Up @@ -79,8 +76,6 @@ public byte[] downloadContent(File file, String downloadUrl) throws StaticConten

public byte[] downloadContentInternal(File file, String downloadUrl) throws UnauthorizedException, StaticContentNotLoadedException {
HttpGet httpGet = new HttpGet(downloadUrl);
RequestConfig params = RequestConfig.custom().setConnectTimeout(TIMEOUT_IN_MILLIS).setSocketTimeout(TIMEOUT_IN_MILLIS).build();
httpGet.setConfig(params);
authentication.applyManualAuthentication(httpGet);
try (CloseableHttpResponse response = httpclient.execute(httpGet)) {
InputStream contentStream = response.getEntity().getContent();
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-text.version>1.11.0</commons-text.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-compress.version>1.26.0</commons-compress.version>
<commons-compress.version>1.27.1</commons-compress.version>
<httpcomponents-client-version>4.5.14</httpcomponents-client-version>
<httpcomponents.core.version>4.4.16</httpcomponents.core.version>

Expand Down Expand Up @@ -69,8 +69,8 @@
<xmlunit.version>2.9.1</xmlunit.version>

<!-- Spring -->
<spring.version>6.1.4</spring.version>
<spring-security.version>6.2.2</spring-security.version>
<spring.version>6.1.13</spring.version>
<spring-security.version>6.3.3</spring-security.version>

<jsoup.version>1.17.2</jsoup.version>
<rome.version>2.1.0</rome.version>
Expand Down
Loading