diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-09 09:06:09 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-09 09:06:09 -0800 |
commit | cd200079f11817ad1439c76c36cb888255db0d4e (patch) | |
tree | bdab1e7b8bebfe8726385db1386e411b56af26a1 /src | |
parent | 85760ee56132c22fd15364e1a897095809dff8b6 (diff) | |
download | DotNetOpenAuth-cd200079f11817ad1439c76c36cb888255db0d4e.zip DotNetOpenAuth-cd200079f11817ad1439c76c36cb888255db0d4e.tar.gz DotNetOpenAuth-cd200079f11817ad1439c76c36cb888255db0d4e.tar.bz2 |
Fixed bug where SSL forwarders' port is incorrectly assumed to be port :80 instead of :443.
Fixes Trac #157
Conflicts:
src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs index 0693926..2fd7be4 100644 --- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs +++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs @@ -325,13 +325,12 @@ namespace DotNetOpenAuth.Messaging { // the public URL: if (request.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 = request.ServerVariables["HTTP_X_FORWARDED_PROTO"] ?? request.Url.Scheme; + Uri hostAndPort = new Uri(scheme + Uri.SchemeDelimiter + request.ServerVariables["HTTP_HOST"]); UriBuilder publicRequestUri = new UriBuilder(request.Url); - Uri hostAndPort = new Uri(request.Url.Scheme + Uri.SchemeDelimiter + request.ServerVariables["HTTP_HOST"]); + publicRequestUri.Scheme = scheme; publicRequestUri.Host = hostAndPort.Host; publicRequestUri.Port = hostAndPort.Port; - if (request.ServerVariables["HTTP_X_FORWARDED_PROTO"] != null) { - publicRequestUri.Scheme = request.ServerVariables["HTTP_X_FORWARDED_PROTO"]; - } return publicRequestUri.Uri; } else { // Failover to the method that works for non-web farm enviroments. |