summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-12-26 08:00:00 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-12-26 08:00:00 -0800
commit06fdacd94eb1a337b6822680336317357885ab48 (patch)
tree3f0a3efa0269c787de6e04ab9dc2cadd13bb13e8 /src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
parent045a7c831e8745bc79edf44041f69b2014d0be85 (diff)
downloadDotNetOpenAuth-06fdacd94eb1a337b6822680336317357885ab48.zip
DotNetOpenAuth-06fdacd94eb1a337b6822680336317357885ab48.tar.gz
DotNetOpenAuth-06fdacd94eb1a337b6822680336317357885ab48.tar.bz2
Fixes timeout in unit tests.
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
index 4b4a3fe..d0f6f63 100644
--- a/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
@@ -61,6 +61,11 @@ namespace DotNetOpenAuth.Messaging {
private readonly NameValueCollection serverVariables;
/// <summary>
+ /// The backing field for the <see cref="Cookies"/> property.
+ /// </summary>
+ private readonly HttpCookieCollection cookies;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="HttpRequestInfo"/> class.
/// </summary>
/// <param name="request">The request.</param>
@@ -75,6 +80,7 @@ namespace DotNetOpenAuth.Messaging {
this.form = new NameValueCollection();
this.queryString = HttpUtility.ParseQueryString(requestUri.Query);
this.serverVariables = new NameValueCollection();
+ this.cookies = new HttpCookieCollection();
Reporting.RecordRequestStatistics(this);
}
@@ -86,7 +92,8 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="requestUri">The request URI.</param>
/// <param name="form">The form variables.</param>
/// <param name="headers">The HTTP headers.</param>
- internal HttpRequestInfo(string httpMethod, Uri requestUri, NameValueCollection form = null, NameValueCollection headers = null) {
+ /// <param name="cookies">The cookies in the request.</param>
+ internal HttpRequestInfo(string httpMethod, Uri requestUri, NameValueCollection form = null, NameValueCollection headers = null, HttpCookieCollection cookies = null) {
Requires.NotNullOrEmpty(httpMethod, "httpMethod");
Requires.NotNull(requestUri, "requestUri");
@@ -96,6 +103,7 @@ namespace DotNetOpenAuth.Messaging {
this.queryString = HttpUtility.ParseQueryString(requestUri.Query);
this.headers = headers ?? new WebHeaderCollection();
this.serverVariables = new NameValueCollection();
+ this.cookies = cookies ?? new HttpCookieCollection();
}
/// <summary>
@@ -111,6 +119,7 @@ namespace DotNetOpenAuth.Messaging {
this.headers = listenerRequest.Headers;
this.form = ParseFormData(listenerRequest.HttpMethod, listenerRequest.Headers, () => listenerRequest.InputStream);
this.serverVariables = new NameValueCollection();
+ this.cookies = new HttpCookieCollection();
Reporting.RecordRequestStatistics(this);
}
@@ -131,6 +140,7 @@ namespace DotNetOpenAuth.Messaging {
AddHeaders(this.headers, request.Content.Headers);
this.form = ParseFormData(this.httpMethod, this.headers, () => request.Content.ReadAsStreamAsync().Result);
this.serverVariables = new NameValueCollection();
+ this.cookies = new HttpCookieCollection();
Reporting.RecordRequestStatistics(this);
}
@@ -153,6 +163,7 @@ namespace DotNetOpenAuth.Messaging {
this.queryString = HttpUtility.ParseQueryString(requestUri.Query);
this.form = ParseFormData(httpMethod, headers, () => inputStream);
this.serverVariables = new NameValueCollection();
+ this.cookies = new HttpCookieCollection();
Reporting.RecordRequestStatistics(this);
}
@@ -207,6 +218,14 @@ namespace DotNetOpenAuth.Messaging {
}
/// <summary>
+ /// Gets the collection of cookies that were sent by the client.
+ /// </summary>
+ /// <returns>The client's cookies.</returns>
+ public override HttpCookieCollection Cookies {
+ get { return this.cookies; }
+ }
+
+ /// <summary>
/// Creates an <see cref="HttpRequestBase"/> instance that describes the specified HTTP request.
/// </summary>
/// <param name="request">The request.</param>