Skip to content

Commit 94303e0

Browse files
nvborisenkodiemol
andauthored
[dotnet] Correct product version in http user agent (#12061)
* Correct product version in http user agent * Remove ununsed AssemblyVersion method --------- Co-authored-by: Diego Molina <[email protected]>
1 parent 3c6c3be commit 94303e0

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dotnet/selenium-dotnet-version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ SUPPORTED_DEVTOOLS_VERSIONS = [
1414

1515
ASSEMBLY_COMPANY = "Selenium Committers"
1616
ASSEMBLY_COPYRIGHT = "Copyright © Software Freedom Conservancy 2023"
17-
ASSEMBLY_INFORMATIONAL_VERSION = "4"
17+
ASSEMBLY_INFORMATIONAL_VERSION = SE_VERSION
1818
ASSEMBLY_PRODUCT = "Selenium"

dotnet/src/support/WebDriver.Support.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Company>Selenium Committers</Company>
1414
<Copyright>Copyright © Software Freedom Conservancy 2018</Copyright>
1515
<Product>Selenium</Product>
16-
<Version>4</Version>
16+
<Version>4.0.0</Version>
1717
<PackageId>Selenium.Support</PackageId>
1818
<AssemblyVersion>4.0.0.0</AssemblyVersion>
1919
<FileVersion>4.0.0.0</FileVersion>

dotnet/src/webdriver/Internal/ResourceUtilities.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ namespace OpenQA.Selenium.Internal
3232
internal static class ResourceUtilities
3333
{
3434
private static string assemblyVersion;
35+
private static string productVersion;
3536
private static string platformFamily;
3637

3738
/// <summary>
38-
/// Gets a string representing the version of the Selenium assembly.
39+
/// Gets a string representing the informational version of the Selenium product.
3940
/// </summary>
40-
public static string AssemblyVersion
41+
public static string ProductVersion
4142
{
4243
get
4344
{
44-
if (string.IsNullOrEmpty(assemblyVersion))
45+
if (productVersion == null)
4546
{
4647
Assembly executingAssembly = Assembly.GetExecutingAssembly();
47-
Version versionResource = executingAssembly.GetName().Version;
48-
assemblyVersion = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.{2}", versionResource.Major, versionResource.Minor, versionResource.Revision);
48+
productVersion = executingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
4949
}
5050

51-
return assemblyVersion;
51+
return productVersion;
5252
}
5353
}
5454

dotnet/src/webdriver/Remote/HttpCommandExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public HttpCommandExecutor(Uri addressOfRemoteServer, TimeSpan timeout, bool ena
7979
addressOfRemoteServer = new Uri(addressOfRemoteServer.ToString() + "/");
8080
}
8181

82-
this.userAgent = string.Format(CultureInfo.InvariantCulture, UserAgentHeaderTemplate, ResourceUtilities.AssemblyVersion, ResourceUtilities.PlatformFamily);
82+
this.userAgent = string.Format(CultureInfo.InvariantCulture, UserAgentHeaderTemplate, ResourceUtilities.ProductVersion, ResourceUtilities.PlatformFamily);
8383
this.remoteServerUri = addressOfRemoteServer;
8484
this.serverResponseTimeout = timeout;
8585
this.enableKeepAlive = enableKeepAlive;

dotnet/src/webdriver/WebDriver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Company>Selenium Committers</Company>
1313
<Copyright>Copyright © Software Freedom Conservancy 2018</Copyright>
1414
<Product>Selenium</Product>
15-
<Version>4</Version>
15+
<Version>4.0.0</Version>
1616
<PackageId>Selenium.WebDriver</PackageId>
1717
<AssemblyVersion>4.0.0.0</AssemblyVersion>
1818
<FileVersion>4.0.0.0</FileVersion>

0 commit comments

Comments
 (0)