[Mono-dev] HttpListenerRequest.HasEntityBody

Miguel de Icaza miguel at novell.com
Fri Mar 9 16:55:02 EST 2007


Hello,

> It looks like our HttpListenerRequest.HasEntityBody is implemented
> not according to RFC2616 section 4.
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

I seem to remember that this is done because it is necessary to
determine which requests we must keep reading from the input, we have
had bugs related to this in the past (in the client instead).


> >From the source
> http://svn.myrealbox.com/source/trunk/mcs/class/System/System.Net/HttpListenerRequest.cs
> it is implemented as
> 
> 	public bool HasEntityBody {
> 		get { return (method == "GET" || method == "HEAD" || content_length <=
> 0 || is_chunked); }
> 	}
> 
> ... but the specification says nothing about the request method.
> 
> So, wouldn't it be conceptually like this?
> 
> 	if (Content-Length <= 0 && Transfer-Encoding == null && Content-Type !=
> "multipart/byteranges")
> 		return false;
> 	return true;
> 
> Atsushi Eno
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list