diff options
author | Mike Roest <msroest@gmail.com> | 2013-01-12 12:09:33 -0800 |
---|---|---|
committer | Mike Roest <msroest@gmail.com> | 2013-01-12 12:09:33 -0800 |
commit | 28dfded556dde4cb6caf3cda796d2d59fa3b4f6b (patch) | |
tree | eeebe2087d7c300122c01edbdcd5a229eaa2651f | |
parent | e264445b6966e927ab1109985966e94d7f2127c8 (diff) | |
download | DotNetOpenAuth-28dfded556dde4cb6caf3cda796d2d59fa3b4f6b.zip DotNetOpenAuth-28dfded556dde4cb6caf3cda796d2d59fa3b4f6b.tar.gz DotNetOpenAuth-28dfded556dde4cb6caf3cda796d2d59fa3b4f6b.tar.bz2 |
Update to support Front_End_Https header used by some loadbalancers for SSL terminiation. As Per http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Common_non-standard_request_headers
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs index 69b111d..e97da5b 100644 --- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs +++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs @@ -1927,7 +1927,8 @@ namespace DotNetOpenAuth.Messaging { // the public URL: if (serverVariables["HTTP_HOST"] != null) { ErrorUtilities.VerifySupported(request.Url.Scheme == Uri.UriSchemeHttps || request.Url.Scheme == Uri.UriSchemeHttp, "Only HTTP and HTTPS are supported protocols."); - string scheme = serverVariables["HTTP_X_FORWARDED_PROTO"] ?? request.Url.Scheme; + string scheme = serverVariables["HTTP_X_FORWARDED_PROTO"] ?? + (String.Equals(serverVariables["HTTP_FRONT_END_HTTPS"], "on", StringComparison.OrdinalIgnoreCase) ? Uri.UriSchemeHttps : request.Url.Scheme); Uri hostAndPort = new Uri(scheme + Uri.SchemeDelimiter + serverVariables["HTTP_HOST"]); UriBuilder publicRequestUri = new UriBuilder(request.Url); publicRequestUri.Scheme = scheme; |