Skip to content

Commit 7b0b32a

Browse files
ragnarstolsmarkRagnar Stølsmark
authored andcommitted
Set the HTTPS server variables as lower case
System.Web.WorkerRequest checks if the HTTPS server variable equals "on" to determine if a request IsSecure. This check is case sensitive. When this check fails the Request.Url is returned without https. https://referencesource.microsoft.com/#System.Web/WorkerRequest.cs,620f7ba656959388
1 parent 4444f94 commit 7b0b32a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/ProxyHeaderModule.Framework.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ internal class ProxyHeaderModule : IHttpModule
2020
private const string ServerPort = "SERVER_PORT";
2121
private const string ForwardedProto = "x-forwarded-proto";
2222
private const string ForwardedHost = "x-forwarded-host";
23-
private const string On = "ON";
24-
private const string Off = "OFF";
23+
private const string On = "on";
24+
private const string Off = "off";
2525

2626
private readonly IOptions<ProxyOptions> _options;
2727

test/Microsoft.AspNetCore.SystemWebAdapters.Framework.Tests/ProxyHeaderModuleTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class ProxyHeaderModuleTests
1818
private const string ServerName = "SERVER_NAME";
1919
private const string ServerPort = "SERVER_PORT";
2020
private const string ServerHttps = "HTTPS";
21-
private const string On = "ON";
22-
private const string Off = "OFF";
21+
private const string On = "on";
22+
private const string Off = "off";
2323

2424
[Fact]
2525
public void NoHeaderChange()

0 commit comments

Comments
 (0)