-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate Windows version when using WinHttpHandler #2229
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#region Copyright notice and license | ||
#region Copyright notice and license | ||
|
||
// Copyright 2019 The gRPC Authors | ||
// | ||
|
@@ -24,6 +24,8 @@ internal interface IOperatingSystem | |
{ | ||
bool IsBrowser { get; } | ||
bool IsAndroid { get; } | ||
bool IsWindows { get; } | ||
Version OSVersion { get; } | ||
} | ||
|
||
internal sealed class OperatingSystem : IOperatingSystem | ||
|
@@ -32,6 +34,8 @@ internal sealed class OperatingSystem : IOperatingSystem | |
|
||
public bool IsBrowser { get; } | ||
public bool IsAndroid { get; } | ||
public bool IsWindows { get; } | ||
public Version OSVersion { get; } | ||
|
||
private OperatingSystem() | ||
{ | ||
|
@@ -41,5 +45,7 @@ private OperatingSystem() | |
#else | ||
IsAndroid = false; | ||
#endif | ||
IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); | ||
OSVersion = Environment.OSVersion.Version; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. excerpt from offline discussion:
Can you confirm that this has been taken into account and that we really rely on Environment.OSVersion.Version providing the right info when on .NET Framework (which is actually where we care about it the most)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, if Environment.OSVersion.Version gives outdated info about build number, in practice this would mean that a high-enough build number would never be detected and creating the GrpcChannel would always throw on .NET Framework? |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comment needs to elaborate on why this particular build version was chosen.
Basically, as you said
The also need to be a note that this will allow creating GrpcChannel on WinServer 2022 with "partial support" (and explain what that is).