Skip to content

Commit b70bf31

Browse files
authored
Fix TNT-42553 ODD artifact still downloaded via HTTPS when Secure=false (#29)
1 parent 9aa8d93 commit b70bf31

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

Source/Adobe.Target.Client/OnDevice/GeoClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111
namespace Adobe.Target.Client.OnDevice
1212
{
13-
using System;
1413
using System.Threading.Tasks;
1514
using Adobe.Target.Delivery.Model;
1615
using RestSharp;
@@ -90,7 +89,7 @@ private Geo HeadersToGeo(Geo originalGeo, IRestResponse response)
9089

9190
private string GetGeoUrl(TargetClientConfig clientConfig)
9291
{
93-
return Uri.UriSchemeHttps + "://" + clientConfig.OnDeviceConfigHostname + GeoPath;
92+
return clientConfig.Protocol + clientConfig.OnDeviceConfigHostname + GeoPath;
9493
}
9594
}
9695
}

Source/Adobe.Target.Client/OnDevice/RuleLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private async Task LoadRulesAsync()
134134
return;
135135
}
136136

137-
RestClient client = new (Uri.UriSchemeHttps + "://" + this.clientConfig.OnDeviceConfigHostname);
137+
RestClient client = new (this.clientConfig.Protocol + this.clientConfig.OnDeviceConfigHostname);
138138

139139
client.ClearHandlers();
140140
client.AddDefaultHeader(AcceptHeader, AcceptHeaderValue);

Source/Adobe.Target.Client/TargetClientConfig.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public sealed class TargetClientConfig
2626
{
2727
private const string ClusterPrefix = "mboxedge";
2828
private const string DefaultDomain = "tt.omtrdc.net";
29-
private const string Https = "https://";
30-
private const string Http = "http://";
3129

3230
private TargetClientConfig()
3331
{
@@ -38,7 +36,7 @@ private TargetClientConfig(Builder builder)
3836
ValidateConfig(builder);
3937
this.Client = builder.Client;
4038
this.OrganizationId = builder.OrganizationId;
41-
this.Protocol = builder.Secure ? Https : Http;
39+
this.Protocol = $"{(builder.Secure ? Uri.UriSchemeHttps : Uri.UriSchemeHttp)}{Uri.SchemeDelimiter}";
4240
this.DefaultPropertyToken = builder.DefaultPropertyToken;
4341
this.DefaultUrl = builder.ServerDomain != DefaultDomain
4442
? $"{this.Protocol}{builder.ServerDomain}"

0 commit comments

Comments
 (0)