Skip to content

Commit

Permalink
Fix TNT-42553 ODD artifact still downloaded via HTTPS when Secure=fal…
Browse files Browse the repository at this point in the history
…se (#29)
  • Loading branch information
XDex authored Oct 27, 2021
1 parent 9aa8d93 commit b70bf31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Source/Adobe.Target.Client/OnDevice/GeoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
namespace Adobe.Target.Client.OnDevice
{
using System;
using System.Threading.Tasks;
using Adobe.Target.Delivery.Model;
using RestSharp;
Expand Down Expand Up @@ -90,7 +89,7 @@ private Geo HeadersToGeo(Geo originalGeo, IRestResponse response)

private string GetGeoUrl(TargetClientConfig clientConfig)
{
return Uri.UriSchemeHttps + "://" + clientConfig.OnDeviceConfigHostname + GeoPath;
return clientConfig.Protocol + clientConfig.OnDeviceConfigHostname + GeoPath;
}
}
}
2 changes: 1 addition & 1 deletion Source/Adobe.Target.Client/OnDevice/RuleLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private async Task LoadRulesAsync()
return;
}

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

client.ClearHandlers();
client.AddDefaultHeader(AcceptHeader, AcceptHeaderValue);
Expand Down
4 changes: 1 addition & 3 deletions Source/Adobe.Target.Client/TargetClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public sealed class TargetClientConfig
{
private const string ClusterPrefix = "mboxedge";
private const string DefaultDomain = "tt.omtrdc.net";
private const string Https = "https://";
private const string Http = "http://";

private TargetClientConfig()
{
Expand All @@ -38,7 +36,7 @@ private TargetClientConfig(Builder builder)
ValidateConfig(builder);
this.Client = builder.Client;
this.OrganizationId = builder.OrganizationId;
this.Protocol = builder.Secure ? Https : Http;
this.Protocol = $"{(builder.Secure ? Uri.UriSchemeHttps : Uri.UriSchemeHttp)}{Uri.SchemeDelimiter}";
this.DefaultPropertyToken = builder.DefaultPropertyToken;
this.DefaultUrl = builder.ServerDomain != DefaultDomain
? $"{this.Protocol}{builder.ServerDomain}"
Expand Down

0 comments on commit b70bf31

Please sign in to comment.