Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Fix for non-seekable network streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Mar 28, 2009
1 parent 2ecd018 commit c6c6eb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs
Expand Up @@ -234,7 +234,10 @@ public class HttpRequestInfo {
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);
Expand Down

0 comments on commit c6c6eb5

Please sign in to comment.