[DO-1519] add messenger master web host and some refactoring (!79)
Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech> Reviewed-on: https://git.avroid.tech/DevOps/jenkins-pipelines/pulls/79 Reviewed-by: Denis Patrakeev <denis.patrakeev@avroid.team>
This commit is contained in:
@@ -34,13 +34,13 @@ import java.util.regex.Pattern
|
||||
def createGetHttpClient(String url, String jenkinsCreds) {
|
||||
def jenkinsCredentials = CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class)
|
||||
def credentials = jenkinsCredentials.findResult { it.id == jenkinsCreds ? it : null }
|
||||
String auth = credentials.username + ":" + credentials.password;
|
||||
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes("utf-8"));
|
||||
String authHeaderValue = "Basic " + encodedAuth;
|
||||
String auth = 'robot' + '\$' + 'ci' + ":" + credentials.password
|
||||
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes("utf-8"))
|
||||
String authHeaderValue = "Basic " + encodedAuth
|
||||
def httpClient = new URL(url).openConnection() as HttpURLConnection
|
||||
httpClient.setRequestMethod('GET');
|
||||
httpClient.setRequestProperty("Authorization", authHeaderValue);
|
||||
httpClient.setRequestProperty("Accept", "application/json");
|
||||
httpClient.setRequestMethod('GET')
|
||||
httpClient.setRequestProperty("Authorization", authHeaderValue)
|
||||
httpClient.setRequestProperty("Accept", "application/json")
|
||||
return httpClient
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user