2003-12-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 12 Dec 2003 07:40:13 +0000 (07:40 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 12 Dec 2003 07:40:13 +0000 (07:40 -0000)
* HttpWebRequest.cs: fixed checking if method allows a body. Patch by
Benjamin Jemlich (pcgod@gmx.net).

svn path=/trunk/mcs/; revision=21062

mcs/class/System/System.Net/ChangeLog
mcs/class/System/System.Net/HttpWebRequest.cs

index e2c3f58f724f5b79bec03100aedfe838e128ddb1..2ffe7c0b126a8ec67302245a5d43f1cd7273e831 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * HttpWebRequest.cs: fixed checking if method allows a body. Patch by
+       Benjamin Jemlich (pcgod@gmx.net).
+
 2003-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * HttpWebRequest.cs: deal with authentication schemes that have more
index cbec452356f13d445f7fff7f4539090165418198..9b5cad20f6ca5a8a575e587e893c217727663c90 100644 (file)
@@ -504,7 +504,7 @@ namespace System.Net
                        if (aborted)
                                throw new WebException ("The request was previosly aborted.");
 
-                       bool send = (method == "PUT" || method == "POST");
+                       bool send = !(method == "GET" || method == "CONNECT" || method == "HEAD");
                        if (method == null || !send)
                                throw new ProtocolViolationException ("Cannot send data when method is: " + method);