From: hniksic Date: Tue, 16 Apr 2002 01:13:51 +0000 (-0700) Subject: [svn] If content-type is not given, assume text/html. X-Git-Tag: v1.13~1781 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=426bf23ae1898355e8812fa65f2b1113f8652c49 [svn] If content-type is not given, assume text/html. --- diff --git a/src/ChangeLog b/src/ChangeLog index d9dd76bd..5d733d60 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-04-16 Hrvoje Niksic + + * http.c (gethttp): If Content-Type is not given, assume + text/html. + 2002-04-15 Hrvoje Niksic * recur.c (download_child_p): Don't ignore rejection of HTML diff --git a/src/http.c b/src/http.c index ea286cd1..3c22bf6c 100644 --- a/src/http.c +++ b/src/http.c @@ -1308,10 +1308,12 @@ Accept: %s\r\n\ } } - if (type && !strncasecmp (type, TEXTHTML_S, strlen (TEXTHTML_S))) + /* If content-type is not given, assume text/html. This is because + of the multitude of broken CGI's that "forget" to generate the + content-type. */ + if (!type || 0 == strncasecmp (type, TEXTHTML_S, strlen (TEXTHTML_S))) *dt |= TEXTHTML; else - /* We don't assume text/html by default. */ *dt &= ~TEXTHTML; if (opt.html_extension && (*dt & TEXTHTML))