[system] Clear content length when redirecting to get request. Fixes #30604
authorMarek Safar <marek.safar@gmail.com>
Thu, 11 Jun 2015 09:27:43 +0000 (11:27 +0200)
committerMarek Safar <marek.safar@gmail.com>
Thu, 11 Jun 2015 09:30:00 +0000 (11:30 +0200)
mcs/class/System/System.Net/HttpWebRequest.cs

index fc30c3ad9be5451a1eee0b8508960c03ac1cd6f1..b9cc121d03c7f6dc1455782f6dbf692a96539330 100644 (file)
@@ -1110,7 +1110,7 @@ namespace System.Net
                        if (e != null)
                                throw e;
 
-                       if (AllowWriteStreamBuffering)
+                       if (AllowWriteStreamBuffering || method == "GET")
                                contentLength = -1;
 
                        uriString = webResponse.Headers ["Location"];