summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-03-27 20:48:31 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-03-27 20:50:09 -0700
commitc6c6eb53789e30f6ba48cee44edbcc5e91467480 (patch)
tree50fc544640c883c71c1c7c48211830f7d35cb3ff
parent2ecd018df1619b2633092ca50c27592b9db73b5b (diff)
downloadDotNetOpenAuth-c6c6eb53789e30f6ba48cee44edbcc5e91467480.zip
DotNetOpenAuth-c6c6eb53789e30f6ba48cee44edbcc5e91467480.tar.gz
DotNetOpenAuth-c6c6eb53789e30f6ba48cee44edbcc5e91467480.tar.bz2
Fix for non-seekable network streams.
-rw-r--r--src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
index cfc122d..418f6b2 100644
--- a/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
+++ b/src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
@@ -234,7 +234,10 @@ namespace DotNetOpenAuth.Messaging {
if (this.form == null) {
if (this.HttpMethod == "POST" && this.Headers[HttpRequestHeader.ContentType] == "application/x-www-form-urlencoded") {
StreamReader reader = new StreamReader(this.InputStream);
- long originalPosition = this.InputStream.Position;
+ long originalPosition = 0;
+ if (this.InputStream.CanSeek) {
+ originalPosition = this.InputStream.Position;
+ }
this.form = HttpUtility.ParseQueryString(reader.ReadToEnd());
if (this.InputStream.CanSeek) {
this.InputStream.Seek(originalPosition, SeekOrigin.Begin);