diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-15 12:08:20 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-15 12:08:20 -0700 |
commit | afe5a981369ebbb1436d2f388c448da8451bb609 (patch) | |
tree | 8b86e1f1abd4fe1584548f4835c8786dc5d1cca3 | |
parent | 5cf3a29accf8ccbc57dbe3a05eee48423769f479 (diff) | |
download | DotNetOpenAuth-afe5a981369ebbb1436d2f388c448da8451bb609.zip DotNetOpenAuth-afe5a981369ebbb1436d2f388c448da8451bb609.tar.gz DotNetOpenAuth-afe5a981369ebbb1436d2f388c448da8451bb609.tar.bz2 |
Fixed failing unit tests.
-rw-r--r-- | src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs | 5 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Messaging/Channel.cs | 6 | ||||
-rw-r--r-- | src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs index f611552..be89ebb 100644 --- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs +++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs @@ -39,7 +39,10 @@ namespace DotNetOpenAuth.Test.Mocks { /// </summary> /// <param name="recipient">The recipient.</param> internal CoordinatingHttpRequestInfo(MessageReceivingEndpoint recipient) { - this.recipient = recipient; + this.recipient = recipient;
+ if (recipient != null) {
+ this.Url = recipient.Location;
+ } if (recipient == null || (recipient.AllowedMethods & HttpDeliveryMethods.GetRequest) != 0) { this.HttpMethod = "GET"; diff --git a/src/DotNetOpenAuth/Messaging/Channel.cs b/src/DotNetOpenAuth/Messaging/Channel.cs index 92bfd1f..c0a20ab 100644 --- a/src/DotNetOpenAuth/Messaging/Channel.cs +++ b/src/DotNetOpenAuth/Messaging/Channel.cs @@ -358,7 +358,11 @@ namespace DotNetOpenAuth.Messaging { /// <returns>The deserialized message, if one is found. Null otherwise.</returns> public IDirectedProtocolMessage ReadFromRequest(HttpRequestInfo httpRequest) { Contract.Requires(httpRequest != null); - Logger.Channel.InfoFormat("Scanning incoming request for messages: {0}", httpRequest.UrlBeforeRewriting.AbsoluteUri); + ErrorUtilities.VerifyArgumentNotNull(httpRequest, "httpRequest"); + + if (Logger.Channel.IsInfoEnabled && httpRequest.UrlBeforeRewriting != null) { + Logger.Channel.InfoFormat("Scanning incoming request for messages: {0}", httpRequest.UrlBeforeRewriting.AbsoluteUri); + } IDirectedProtocolMessage requestMessage = this.ReadFromRequestCore(httpRequest); if (requestMessage != null) { Logger.Channel.DebugFormat("Incoming request received: {0}", requestMessage.GetType().Name); diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs index 418f6b2..367c14f 100644 --- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs +++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs @@ -194,8 +194,9 @@ namespace DotNetOpenAuth.Messaging { /// </summary> internal Uri UrlBeforeRewriting { get { - Contract.Requires(this.Url != null); - Contract.Requires(this.RawUrl != null); + if (this.Url == null || this.RawUrl == null) { + return null; + } // 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 |