diff options
Diffstat (limited to 'src/DotNetOpenAuth')
-rw-r--r-- | src/DotNetOpenAuth/DotNetOpenAuth.csproj | 4 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs | 5 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Messaging/MessagingUtilities.cs | 4 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Xrds/ServiceElement.cs | 4 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Xrds/XrdElement.cs | 4 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Xrds/XrdsNode.cs | 4 |
6 files changed, 17 insertions, 8 deletions
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj index ac2e516..01c4dd4 100644 --- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj +++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj @@ -18,7 +18,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>..\..\bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> + <DefineConstants>TRACE;DEBUG;Mono</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> @@ -53,7 +53,7 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>..\..\bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants>TRACE;Mono</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs index 9e9deb4..09edc01 100644 --- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs +++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs @@ -57,6 +57,7 @@ namespace DotNetOpenAuth.Messaging { this.Url = request.Url; this.UrlBeforeRewriting = GetPublicFacingUrl(request); this.RawUrl = request.RawUrl; + Logger.Messaging.InfoFormat("Url: {0}, RawUrl: {1}", this.Url, this.RawUrl); this.Headers = GetHeaderCollection(request.Headers); this.InputStream = request.InputStream; @@ -319,6 +320,7 @@ namespace DotNetOpenAuth.Messaging { // HttpRequest.Url gives us the internal URL in a cloud environment, // So we use a variable that (at least from what I can tell) gives us // the public URL: +#if !Mono // In ASP.NET MVC, Mono adds UrlRouting.axd to the URL here, which breaks OpenID return_to verification. 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; @@ -329,6 +331,7 @@ namespace DotNetOpenAuth.Messaging { publicRequestUri.Port = hostAndPort.Port; return publicRequestUri.Uri; } else { +#endif // Failover to the method that works for non-web farm enviroments. // We use Request.Url for the full path to the server, and modify it // with Request.RawUrl to capture both the cookieless session "directory" if it exists @@ -338,7 +341,9 @@ namespace DotNetOpenAuth.Messaging { // Response.ApplyAppPathModifier(builder.Path) would have worked for the cookieless // session, but not the URL rewriting problem. return new Uri(request.Url, request.RawUrl); +#if !Mono } +#endif } /// <summary> diff --git a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs index 7d89b4e..38c431f 100644 --- a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs +++ b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs @@ -371,14 +371,18 @@ namespace DotNetOpenAuth.Messaging { newRequest.AllowAutoRedirect = request.AllowAutoRedirect; newRequest.AllowWriteStreamBuffering = request.AllowWriteStreamBuffering; newRequest.AuthenticationLevel = request.AuthenticationLevel; +#if !Mono newRequest.AutomaticDecompression = request.AutomaticDecompression; newRequest.CachePolicy = request.CachePolicy; newRequest.ClientCertificates = request.ClientCertificates; +#endif newRequest.ConnectionGroupName = request.ConnectionGroupName; newRequest.ContinueDelegate = request.ContinueDelegate; newRequest.CookieContainer = request.CookieContainer; newRequest.Credentials = request.Credentials; +#if !Mono newRequest.ImpersonationLevel = request.ImpersonationLevel; +#endif newRequest.MaximumAutomaticRedirections = request.MaximumAutomaticRedirections; newRequest.MaximumResponseHeadersLength = request.MaximumResponseHeadersLength; newRequest.MediaType = request.MediaType; diff --git a/src/DotNetOpenAuth/Xrds/ServiceElement.cs b/src/DotNetOpenAuth/Xrds/ServiceElement.cs index 0acf2b5..647ef42 100644 --- a/src/DotNetOpenAuth/Xrds/ServiceElement.cs +++ b/src/DotNetOpenAuth/Xrds/ServiceElement.cs @@ -48,7 +48,7 @@ namespace DotNetOpenAuth.Xrds { get { List<UriElement> uris = new List<UriElement>(); foreach (XPathNavigator node in Node.Select("xrd:URI", XmlNamespaceResolver)) { - uris.Add(new UriElement(node, this)); + uris.Add(new UriElement(node.Clone(), this)); } uris.Sort(); return uris; @@ -62,7 +62,7 @@ namespace DotNetOpenAuth.Xrds { public IEnumerable<TypeElement> TypeElements { get { foreach (XPathNavigator node in Node.Select("xrd:Type", XmlNamespaceResolver)) { - yield return new TypeElement(node, this); + yield return new TypeElement(node.Clone(), this); } } } diff --git a/src/DotNetOpenAuth/Xrds/XrdElement.cs b/src/DotNetOpenAuth/Xrds/XrdElement.cs index a8cc145..2c03da8 100644 --- a/src/DotNetOpenAuth/Xrds/XrdElement.cs +++ b/src/DotNetOpenAuth/Xrds/XrdElement.cs @@ -35,7 +35,7 @@ namespace DotNetOpenAuth.Xrds { // We should enumerate them in priority order List<ServiceElement> services = new List<ServiceElement>(); foreach (XPathNavigator node in Node.Select("xrd:Service", XmlNamespaceResolver)) { - services.Add(new ServiceElement(node, this)); + services.Add(new ServiceElement(node.Clone(), this)); // .Clone() to workaround XPathNavigator mono bug } services.Sort(); return services; @@ -149,7 +149,7 @@ namespace DotNetOpenAuth.Xrds { xpath.Append("]"); var services = new List<ServiceElement>(); foreach (XPathNavigator service in Node.Select(xpath.ToString(), XmlNamespaceResolver)) { - services.Add(new ServiceElement(service, this)); + services.Add(new ServiceElement(service.Clone(), this)); // .Clone() to workaround XPathNavigator mono bug } // Put the services in their own defined priority order diff --git a/src/DotNetOpenAuth/Xrds/XrdsNode.cs b/src/DotNetOpenAuth/Xrds/XrdsNode.cs index e27a1b2..e2e5e78 100644 --- a/src/DotNetOpenAuth/Xrds/XrdsNode.cs +++ b/src/DotNetOpenAuth/Xrds/XrdsNode.cs @@ -32,7 +32,7 @@ namespace DotNetOpenAuth.Xrds { ErrorUtilities.VerifyArgumentNotNull(node, "node"); ErrorUtilities.VerifyArgumentNotNull(parentNode, "parentNode"); - this.Node = node; + this.Node = node.Clone(); this.ParentNode = parentNode; this.XmlNamespaceResolver = this.ParentNode.XmlNamespaceResolver; } @@ -44,7 +44,7 @@ namespace DotNetOpenAuth.Xrds { protected XrdsNode(XPathNavigator document) { ErrorUtilities.VerifyArgumentNotNull(document, "document"); - this.Node = document; + this.Node = document.Clone(); this.XmlNamespaceResolver = new XmlNamespaceManager(document.NameTable); } |