[HttpWebRequest] Only uppercase known methods
[mono.git] / mcs / class / System / System.Net / HttpWebRequest.cs
index 6c0921c3746a6de17f489483ecd98485c00ddf83..3d0de5761873163830d5c0bfa8b8fb77985a388d 100644 (file)
@@ -499,6 +499,11 @@ namespace System.Net
                                        throw new ArgumentException ("not a valid method");
 
                                method = value.ToUpperInvariant ();
+                               if (method != "HEAD" && method != "GET" && method != "POST" && method != "PUT" &&
+                                       method != "DELETE" && method != "CONNECT" && method != "TRACE" &&
+                                       method != "MKCOL") {
+                                       method = value;
+                               }
                        }
                }