diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-02 11:33:12 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-07-02 11:33:12 +0400 |
commit | 7ff2c1978d3cd77cd525255f70520c3556462811 (patch) | |
tree | 1c61cebf2e5f7e11cb4722919aec27058951c85b /mcs/class/System | |
parent | 1c8629a808c3d5ae64926d6e274580fff7930326 (diff) |
2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
* HttpWebRequest.cs: avoid duplicating Accept-Encoding if GetHeaders()
is called twice.
* WebConnectionStream.cs: don't send a 0 content length for non-write
requests.
svn path=/trunk/mcs/; revision=137233
Diffstat (limited to 'mcs/class/System')
-rw-r--r-- | mcs/class/System/System.Net/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System/System.Net/HttpWebRequest.cs | 2 | ||||
-rw-r--r-- | mcs/class/System/System.Net/WebConnectionStream.cs | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog index 8acc2e07e70..3629fb0b92e 100644 --- a/mcs/class/System/System.Net/ChangeLog +++ b/mcs/class/System/System.Net/ChangeLog @@ -1,5 +1,12 @@ 2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com> + * HttpWebRequest.cs: avoid duplicating Accept-Encoding if GetHeaders() + is called twice. + * WebConnectionStream.cs: don't send a 0 content length for non-write + requests. + +2009-07-02 Gonzalo Paniagua Javier <gonzalo@novell.com> + * WebConnection.cs: must use the 'int' version in 1.1. 2009-07-01 Gonzalo Paniagua Javier <gonzalo@novell.com> diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 7f2e805b22a..70426744fdc 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -1043,7 +1043,7 @@ namespace System.Net if ((auto_decomp & DecompressionMethods.Deflate) != 0) accept_encoding = accept_encoding != null ? "gzip, deflate" : "deflate"; if (accept_encoding != null) - webHeaders.SetInternal ("Accept-Encoding", accept_encoding); + webHeaders.RemoveAndAdd ("Accept-Encoding", accept_encoding); #endif if (!usedPreAuth && preAuthenticate) DoPreAuthenticate (); diff --git a/mcs/class/System/System.Net/WebConnectionStream.cs b/mcs/class/System/System.Net/WebConnectionStream.cs index 60aa236357d..800901d8d7d 100644 --- a/mcs/class/System/System.Net/WebConnectionStream.cs +++ b/mcs/class/System/System.Net/WebConnectionStream.cs @@ -680,7 +680,10 @@ namespace System.Net } if (!headersSent) { - request.InternalContentLength = length; + bool no_writestream = (method == "GET" || method == "CONNECT" || method == "HEAD" || + method == "TRACE" || method == "DELETE"); + if (!no_writestream) + request.InternalContentLength = length; request.SendRequestHeaders (); } WriteHeaders (); |