From bfe4e645c32988fc5f5cf64e764d359f60b98a96 Mon Sep 17 00:00:00 2001
From: Mike Chu <104384559+mikechu-optimizely@users.noreply.github.com>
Date: Tue, 15 Aug 2023 20:49:16 -0400
Subject: [PATCH] [FSSDK-8663] chore: General clean up before ticket work
(#367)
* Fix Rider-identified problems
* Fix invalid AssemblyFileVersion as noted by GitHub
* Remove unused field
* Remove App_Data from proj
* Upgrade Newtonsoft.Json for vulnerability in Demo & Test projs
Now matching other projs at 13.0.2
* Code review changes
---
.../OptimizelySDK.DemoApp.csproj | 6 +----
.../Views/Shared/_Layout.cshtml | 8 +++---
OptimizelySDK.DemoApp/packages.config | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/AssemblyInfo.cs | 2 +-
OptimizelySDK.Tests/App.config | 27 ++++++-------------
.../Properties/AssemblyInfo.cs | 2 +-
OptimizelySDK.Tests/packages.config | 14 +++++-----
OptimizelySDK.sln | 3 ---
.../Config/HttpProjectConfigManager.cs | 4 +--
OptimizelySDK/OptimizelyDecisionContext.cs | 1 -
OptimizelySDK/Properties/AssemblyInfo.cs | 2 +-
14 files changed, 29 insertions(+), 48 deletions(-)
diff --git a/OptimizelySDK.DemoApp/OptimizelySDK.DemoApp.csproj b/OptimizelySDK.DemoApp/OptimizelySDK.DemoApp.csproj
index 0f0c0d62..e8c284ff 100644
--- a/OptimizelySDK.DemoApp/OptimizelySDK.DemoApp.csproj
+++ b/OptimizelySDK.DemoApp/OptimizelySDK.DemoApp.csproj
@@ -65,8 +65,7 @@
True
- ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
- True
+ ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll
@@ -249,9 +248,6 @@
-
-
-
diff --git a/OptimizelySDK.DemoApp/Views/Shared/_Layout.cshtml b/OptimizelySDK.DemoApp/Views/Shared/_Layout.cshtml
index 6b43634a..a8848d76 100644
--- a/OptimizelySDK.DemoApp/Views/Shared/_Layout.cshtml
+++ b/OptimizelySDK.DemoApp/Views/Shared/_Layout.cshtml
@@ -1,12 +1,12 @@
@{
/*
- * Copyright 2017-2018, Optimizely
+ * Copyright 2017-2018, 2023 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,7 +17,7 @@
}
-
+
@@ -37,7 +37,7 @@
@Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "nav-link" })
- @Html.ActionLink("Demo", "Index", "Demo/Config", new { area = "" }, new { @class = "nav-link" })
+ @Html.ActionLink("Demo", "Config", "Demo", new { area = "" }, new { @class = "nav-link" })
diff --git a/OptimizelySDK.DemoApp/packages.config b/OptimizelySDK.DemoApp/packages.config
index e13f0245..1592587b 100644
--- a/OptimizelySDK.DemoApp/packages.config
+++ b/OptimizelySDK.DemoApp/packages.config
@@ -15,7 +15,7 @@
-
+
diff --git a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs
index c30032e8..69b04e7f 100644
--- a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs
@@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
diff --git a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs
index 2cd7b68a..c3e01c00 100644
--- a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs
@@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
diff --git a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs
index 9c98ed60..7ba7db50 100644
--- a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs
@@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
diff --git a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs
index 3b263f57..e493466c 100644
--- a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs
@@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
diff --git a/OptimizelySDK.Tests/App.config b/OptimizelySDK.Tests/App.config
index 3d6d5412..f71b6648 100644
--- a/OptimizelySDK.Tests/App.config
+++ b/OptimizelySDK.Tests/App.config
@@ -6,26 +6,15 @@
-
+
-
+
-
+
@@ -36,16 +25,16 @@
-
-
+
+
-
-
+
+
-
+
diff --git a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs
index 4396ff81..8ceae607 100644
--- a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
diff --git a/OptimizelySDK.Tests/packages.config b/OptimizelySDK.Tests/packages.config
index 166ddc9d..4d51a3f4 100644
--- a/OptimizelySDK.Tests/packages.config
+++ b/OptimizelySDK.Tests/packages.config
@@ -1,10 +1,10 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/OptimizelySDK.sln b/OptimizelySDK.sln
index 66e8424c..4fb4cac3 100644
--- a/OptimizelySDK.sln
+++ b/OptimizelySDK.sln
@@ -16,10 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
CHANGELOG.MD = CHANGELOG.MD
CONTRIBUTING.md = CONTRIBUTING.md
- OptimizelySDK.Package\OptimizelySDK.nuspec = OptimizelySDK.Package\OptimizelySDK.nuspec
- OptimizelySDK.Package\pack.ps1 = OptimizelySDK.Package\pack.ps1
README.md = README.md
- OptimizelySDK.Package\verifysn.ps1 = OptimizelySDK.Package\verifysn.ps1
keypair.snk = keypair.snk
EndProjectSection
EndProject
diff --git a/OptimizelySDK/Config/HttpProjectConfigManager.cs b/OptimizelySDK/Config/HttpProjectConfigManager.cs
index fecd0a92..a3f51052 100644
--- a/OptimizelySDK/Config/HttpProjectConfigManager.cs
+++ b/OptimizelySDK/Config/HttpProjectConfigManager.cs
@@ -19,6 +19,7 @@
#endif
using System;
+using System.Linq;
using System.Net;
using System.Threading.Tasks;
using OptimizelySDK.ErrorHandler;
@@ -179,7 +180,7 @@ private string GetRemoteDatafileResponse()
}
var lastModified = result.Headers.GetValues("Last-Modified");
- if (!string.IsNullOrEmpty(lastModified.First()))
+ if (!string.IsNullOrEmpty(lastModified?.First()))
{
LastModifiedSince = lastModified.First();
}
@@ -234,7 +235,6 @@ public class Builder
private bool StartByDefault = true;
private NotificationCenter NotificationCenter;
-
private bool IsBlockingTimeoutProvided = false;
private bool IsPollingIntervalProvided = false;
diff --git a/OptimizelySDK/OptimizelyDecisionContext.cs b/OptimizelySDK/OptimizelyDecisionContext.cs
index 69b1d6f8..39c06143 100644
--- a/OptimizelySDK/OptimizelyDecisionContext.cs
+++ b/OptimizelySDK/OptimizelyDecisionContext.cs
@@ -27,7 +27,6 @@ public class OptimizelyDecisionContext
private string flagKey;
private string ruleKey;
- private string decisionKey;
///
/// Represents the object is valid or not.
diff --git a/OptimizelySDK/Properties/AssemblyInfo.cs b/OptimizelySDK/Properties/AssemblyInfo.cs
index 44e9e2ce..07e29d0a 100644
--- a/OptimizelySDK/Properties/AssemblyInfo.cs
+++ b/OptimizelySDK/Properties/AssemblyInfo.cs
@@ -42,5 +42,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0-beta")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.