aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-alm-client
diff options
context:
space:
mode:
authorAurelien Poscia <aurelien.poscia@sonarsource.com>2022-03-15 14:40:51 +0100
committersonartech <sonartech@sonarsource.com>2022-03-16 20:03:28 +0000
commit89223059425c0750801c2e2cb19b8c9a1da8fdc8 (patch)
treeab009ad47298204cecd342e38a5359b10e501396 /server/sonar-alm-client
parent39f053519df625b36025cad0b0a000208b49760f (diff)
downloadsonarqube-89223059425c0750801c2e2cb19b8c9a1da8fdc8.tar.gz
sonarqube-89223059425c0750801c2e2cb19b8c9a1da8fdc8.zip
SONAR-14721 SONAR-14722 SONAR-14723 do not follow redirects when interacting with ALM APIs
Diffstat (limited to 'server/sonar-alm-client')
-rw-r--r--server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java1
-rw-r--r--server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucketserver/BitbucketServerRestClient.java1
-rw-r--r--server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationHttpClientImpl.java7
3 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java
index 7727d7cb0f0..818169de5b0 100644
--- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java
+++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/azure/AzureDevOpsHttpClient.java
@@ -59,6 +59,7 @@ public class AzureDevOpsHttpClient {
client = new OkHttpClientBuilder()
.setConnectTimeoutMs(timeoutConfiguration.getConnectTimeout())
.setReadTimeoutMs(timeoutConfiguration.getReadTimeout())
+ .setFollowRedirects(false)
.build();
}
diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucketserver/BitbucketServerRestClient.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucketserver/BitbucketServerRestClient.java
index 0e4eac5b875..8eda23af724 100644
--- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucketserver/BitbucketServerRestClient.java
+++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucketserver/BitbucketServerRestClient.java
@@ -64,6 +64,7 @@ public class BitbucketServerRestClient {
client = okHttpClientBuilder
.setConnectTimeoutMs(timeoutConfiguration.getConnectTimeout())
.setReadTimeoutMs(timeoutConfiguration.getReadTimeout())
+ .setFollowRedirects(false)
.build();
}
diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationHttpClientImpl.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationHttpClientImpl.java
index 773acb8aaa7..5dc612914c0 100644
--- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationHttpClientImpl.java
+++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubApplicationHttpClientImpl.java
@@ -59,9 +59,10 @@ public class GithubApplicationHttpClientImpl implements GithubApplicationHttpCli
public GithubApplicationHttpClientImpl(TimeoutConfiguration timeoutConfiguration) {
client = new OkHttpClientBuilder()
- .setConnectTimeoutMs(timeoutConfiguration.getConnectTimeout())
- .setReadTimeoutMs(timeoutConfiguration.getReadTimeout())
- .build();
+ .setConnectTimeoutMs(timeoutConfiguration.getConnectTimeout())
+ .setReadTimeoutMs(timeoutConfiguration.getReadTimeout())
+ .setFollowRedirects(false)
+ .build();
}
@Override