diff --git a/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs b/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs index 7767263b9d..2a1d43d963 100644 --- a/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs +++ b/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs @@ -572,7 +572,7 @@ namespace Microsoft.AspNetCore.Mvc if (protocol == null) { - protocol = httpContext.Request.Protocol; + protocol = httpContext.Request.Scheme; } if (host == null) @@ -624,7 +624,7 @@ namespace Microsoft.AspNetCore.Mvc if (protocol == null) { - protocol = httpContext.Request.Protocol; + protocol = httpContext.Request.Scheme; } if (host == null) diff --git a/src/Mvc/Mvc.Core/test/Routing/UrlHelperExtensionsTest.cs b/src/Mvc/Mvc.Core/test/Routing/UrlHelperExtensionsTest.cs index 2f170b1c56..02ebfc549b 100644 --- a/src/Mvc/Mvc.Core/test/Routing/UrlHelperExtensionsTest.cs +++ b/src/Mvc/Mvc.Core/test/Routing/UrlHelperExtensionsTest.cs @@ -615,7 +615,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = expectedProtocol, + Scheme = expectedProtocol, Host = new HostString(expectedHost), } }; @@ -650,7 +650,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = "http://", + Scheme = "http://", Host = new HostString(expectedHost), } }; @@ -685,7 +685,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = expectedProtocol, + Scheme = expectedProtocol, Host = new HostString("www.asp.net"), } }; @@ -723,7 +723,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = expectedProtocol, + Scheme = expectedProtocol, Host = new HostString(expectedHost), } }, @@ -771,7 +771,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = "http://", + Scheme = "http://", Host = new HostString(expectedHost), } }, @@ -819,7 +819,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing { Request = { - Protocol = expectedProtocol, + Scheme = expectedProtocol, Host = new HostString("www.asp.net"), } },