Add Win8 check
This commit is contained in:
parent
d8209b6cd4
commit
c967382e89
|
|
@ -22,6 +22,7 @@
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using Microsoft.Extensions.Internal;
|
||||||
|
|
||||||
namespace Microsoft.Net.Http.Server
|
namespace Microsoft.Net.Http.Server
|
||||||
{
|
{
|
||||||
|
|
@ -32,11 +33,12 @@ namespace Microsoft.Net.Http.Server
|
||||||
|
|
||||||
static ComNetOS()
|
static ComNetOS()
|
||||||
{
|
{
|
||||||
|
var win8Version = new Version(6, 2);
|
||||||
|
|
||||||
#if NETSTANDARD1_3
|
#if NETSTANDARD1_3
|
||||||
// TODO: SkipIOCPCallbackOnSuccess doesn't work on Win7. Need a way to detect Win7 vs 8+.
|
// TODO: SkipIOCPCallbackOnSuccess doesn't work on Win7. Need a way to detect Win7 vs 8+.
|
||||||
IsWin8orLater = false;
|
IsWin8orLater = (new Version(RuntimeEnvironment.OperatingSystemVersion) >= win8Version);
|
||||||
#else
|
#else
|
||||||
var win8Version = new Version(6, 2);
|
|
||||||
IsWin8orLater = (Environment.OSVersion.Version >= win8Version);
|
IsWin8orLater = (Environment.OSVersion.Version >= win8Version);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -284,8 +284,7 @@ namespace Microsoft.Net.Http.Server
|
||||||
public string Scheme => IsHttps ? Constants.HttpsScheme : Constants.HttpScheme;
|
public string Scheme => IsHttps ? Constants.HttpsScheme : Constants.HttpScheme;
|
||||||
|
|
||||||
// HTTP.Sys allows you to upgrade anything to opaque unless content-length > 0 or chunked are specified.
|
// HTTP.Sys allows you to upgrade anything to opaque unless content-length > 0 or chunked are specified.
|
||||||
// TODO: >= Win8 check https://github.com/aspnet/WebListener/issues/215
|
internal bool IsUpgradable => !HasEntityBody && ComNetOS.IsWin8orLater;
|
||||||
internal bool IsUpgradable => !HasEntityBody;
|
|
||||||
|
|
||||||
public string ContentType => Headers[HttpKnownHeaderNames.ContentType];
|
public string ContentType => Headers[HttpKnownHeaderNames.ContentType];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ namespace Microsoft.Net.Http.Server
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// https://github.com/aspnet/WebListener/issues/215
|
return ComNetOS.IsWin8orLater;
|
||||||
return true; // TODO: ComNetOS.IsWin8orLater;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@
|
||||||
},
|
},
|
||||||
"netstandard1.3": {
|
"netstandard1.3": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.RuntimeEnvironment.Sources": {
|
||||||
|
"type": "build",
|
||||||
|
"version": "1.1.0-*"
|
||||||
|
},
|
||||||
"Microsoft.Win32.Primitives": "4.0.1-*",
|
"Microsoft.Win32.Primitives": "4.0.1-*",
|
||||||
"System.Diagnostics.Contracts": "4.0.1-*",
|
"System.Diagnostics.Contracts": "4.0.1-*",
|
||||||
"System.Diagnostics.Debug": "4.0.11-*",
|
"System.Diagnostics.Debug": "4.0.11-*",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue