]> sjero.net Git - wget/blobdiff - src/http.c
Fix a hang on redirects which change the transfer-encoding
[wget] / src / http.c
index 247ba6748096f56153d4922a23a4314552529bb0..b7026cd8fa9f44bf4adb5ba593d50cf4cbd1530f 100644 (file)
@@ -2040,8 +2040,9 @@ read_header:
         }
     }
 
-  resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval));
-  if (0 == strcasecmp (hdrval, "chunked"))
+  chunked_transfer_encoding = false;
+  if (resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval))
+      && 0 == strcasecmp (hdrval, "chunked"))
     chunked_transfer_encoding = true;
 
   /* Handle (possibly multiple instances of) the Set-Cookie header. */