Skip to content

Commit e047cd1

Browse files
authored
Merge pull request #53 from PTCInc/chore-initial-release-cleanup
Chore initial release cleanup
2 parents 481392a + eb944c5 commit e047cd1

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Kepware.Api/KepwareApiServiceCollectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ private static Action<HttpClient> ConfigureHttpClient(KepwareApiClientOptions op
160160
client.BaseAddress = options.HostUri;
161161
client.Timeout = options.Timeout;
162162
client.DefaultRequestHeaders.Add("Accept", "application/json");
163-
client.DefaultRequestHeaders.Add("User-Agent", "KepwareSync");
163+
client.DefaultRequestHeaders.Add("User-Agent", "Kepware.Api Client");
164164

165-
if (!string.IsNullOrEmpty(options.Username) && !string.IsNullOrEmpty(options.Password))
165+
if (!string.IsNullOrEmpty(options.Username))
166166
{
167-
string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{options.Username}:{options.Password}"));
167+
string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{options.Username}:{options.Password ?? string.Empty}"));
168168
client.DefaultRequestHeaders.Add("Authorization", $"Basic {credentials}");
169169
}
170170

Kepware.Api/Model/ApiMessages.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ public ProductType ProductType
150150
/// </summary>
151151
[JsonIgnore]
152152
public bool SupportsJsonProjectLoadService =>
153+
// Supported in KEPServerEX 6.17+, ThingWorx Kepware Server 6.17+, Kepware Edge, and ThingWorx Kepware Edge 1.10+
154+
// Kepware Edge and ThingWorx Kepware Edge use the same ProductType and are differentiated by ProductName
153155
(ProductType == ProductType.KepwareServer && (ProductVersionMajor > 6 || (ProductVersionMajor == 6 && ProductVersionMinor >= 17))) ||
154156
(ProductType == ProductType.KepwareEdge && (ProductVersionMajor > 1 || (ProductVersionMajor == 1 && ProductVersionMinor >= 10))) ||
155157
(ProductType == ProductType.KepwareEdge && ProductName == "Kepware Edge");
158+
156159
}
157160

158161

0 commit comments

Comments
 (0)