diff --git a/src/AspNetCoreModuleV2/CommonLib/aspnetcoreconfig.cxx b/src/AspNetCoreModuleV2/CommonLib/aspnetcoreconfig.cxx index 97a7d0c63e..46ec0edcfd 100644 --- a/src/AspNetCoreModuleV2/CommonLib/aspnetcoreconfig.cxx +++ b/src/AspNetCoreModuleV2/CommonLib/aspnetcoreconfig.cxx @@ -178,7 +178,6 @@ ASPNETCORE_CONFIG::Populate( IAppHostElement *pWindowsAuthenticationElement = NULL; IAppHostElement *pBasicAuthenticationElement = NULL; IAppHostElement *pAnonymousAuthenticationElement = NULL; - IAppHostElement *pWebSocketElement = NULL; IAppHostElement *pEnvVarList = NULL; IAppHostElement *pEnvVar = NULL; IAppHostElementCollection *pEnvVarCollection = NULL; @@ -192,7 +191,6 @@ ASPNETCORE_CONFIG::Populate( BSTR bstrBasicAuthSection = NULL; BSTR bstrAnonymousAuthSection = NULL; BSTR bstrAspNetCoreSection = NULL; - BSTR bstrWebsocketSection = NULL; m_pEnvironmentVariables = new ENVIRONMENT_VAR_HASH(); if (m_pEnvironmentVariables == NULL) @@ -322,29 +320,18 @@ ASPNETCORE_CONFIG::Populate( } } - bstrWebsocketSection = SysAllocString(CS_WEBSOCKET_SECTION); - if (bstrWebsocketSection == NULL) - { - hr = E_OUTOFMEMORY; - goto Finished; - } - - hr = pAdminManager->GetAdminSection(bstrWebsocketSection, - m_struConfigPath.QueryStr(), - &pWebSocketElement); + // Even though the applicationhost.config file contains the websocket element, + // the websocket module may still not be enabled. Check if the + PCWSTR pszVariableValue; + DWORD cbLength; + hr = pHttpContext->GetServerVariable("WEBSOCKET_VERSION", &pszVariableValue, &cbLength); if (FAILED(hr)) { m_fWebSocketEnabled = FALSE; } else { - hr = GetElementBoolProperty(pWebSocketElement, - CS_ENABLED, - &m_fWebSocketEnabled); - if (FAILED(hr)) - { - goto Finished; - } + m_fWebSocketEnabled = TRUE; } bstrAspNetCoreSection = SysAllocString(CS_ASPNETCORE_SECTION); @@ -557,12 +544,6 @@ Finished: pAspNetCoreElement = NULL; } - if (pWebSocketElement != NULL) - { - pWebSocketElement->Release(); - pWebSocketElement = NULL; - } - if (pWindowsAuthenticationElement != NULL) { pWindowsAuthenticationElement->Release(); diff --git a/src/AspNetCoreModuleV2/RequestHandler/environmentvariablehelpers.h b/src/AspNetCoreModuleV2/RequestHandler/environmentvariablehelpers.h index 268011d30a..d7df903554 100644 --- a/src/AspNetCoreModuleV2/RequestHandler/environmentvariablehelpers.h +++ b/src/AspNetCoreModuleV2/RequestHandler/environmentvariablehelpers.h @@ -362,7 +362,6 @@ public: return hr; } - static HRESULT AddWebsocketEnabledToEnvironmentVariables diff --git a/test/IISIntegration.FunctionalTests/UpgradeFeatureDetectionTests.cs b/test/IISIntegration.FunctionalTests/UpgradeFeatureDetectionTests.cs index 9ff8f906b9..d566b4c330 100644 --- a/test/IISIntegration.FunctionalTests/UpgradeFeatureDetectionTests.cs +++ b/test/IISIntegration.FunctionalTests/UpgradeFeatureDetectionTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests } [Fact] - public Task UpgradeFeatureDetectionEnabled_InProcess_IISExpress_CoreClr_x64_Portable() + public Task UpgradeFeatureDetectionDisabled_InProcess_IISExpress_CoreClr_x64_Portable() { return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr, ApplicationType.Portable, @@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests } [Fact] - public Task UpgradeFeatureDetectionDisabled_InProcess_IISExpress_CoreClr_x64_Portable() + public Task UpgradeFeatureDetectionEnabled_InProcess_IISExpress_CoreClr_x64_Portable() { return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr, ApplicationType.Portable, @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests } [Fact] - public Task UpgradeFeatureDetectionEnabled_OutOfProcess_IISExpress_CoreClr_x64_Portable() + public Task UpgradeFeatureDetectionDisabled_OutOfProcess_IISExpress_CoreClr_x64_Portable() { return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr, ApplicationType.Portable, @@ -52,8 +52,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests "Disabled"); } + // This test is failing on win7 and win2008 [Fact] - public Task UpgradeFeatureDetectionDisabled_OutOfProcess_IISExpress_CoreClr_x64_Portable() + public Task UpgradeFeatureDetectionEnabled_OutOfProcess_IISExpress_CoreClr_x64_Portable() { return UpgradeFeatureDetectionDeployer(RuntimeFlavor.CoreClr, ApplicationType.Portable, @@ -89,7 +90,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { var deploymentResult = await deployer.DeployAsync(); deploymentResult.HttpClient.Timeout = TimeSpan.FromSeconds(5); - // Request to base address and check if various parts of the body are rendered & measure the cold startup time. var response = await RetryHelper.RetryRequest(() => {