2009-08-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sat, 29 Aug 2009 21:09:20 +0000 (21:09 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sat, 29 Aug 2009 21:09:20 +0000 (21:09 -0000)
* WebConnection.cs: HEAD response does not have a body even if the
response is an error. Fixes buf #535102.

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

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

index 769a502b74d943595020be60008f728d67b16b7b..22d90b75168cfa62e5e4f33836357537583eb88b 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * WebConnection.cs: HEAD response does not have a body even if the
+       response is an error. Fixes buf #535102.
+
 2009-08-17  Geoff Norton  <gnorton@novell.com>
 
        * NtlmClient.cs: Mono.Http does not exist on monotouch
index 09b6f6bed0502f51eb9559899119213e15143ddb..2fce3d359f3edce5eaaa9699bf211c408a5538f2 100644 (file)
@@ -464,7 +464,7 @@ namespace System.Net
 
                        data.stream = stream;
                        
-                       if (!ExpectContent (data.StatusCode))
+                       if (!ExpectContent (data.StatusCode) || data.request.Method == "HEAD")
                                stream.ForceCompletion ();
 
                        data.request.SetResponseData (data);