From 426bf23ae1898355e8812fa65f2b1113f8652c49 Mon Sep 17 00:00:00 2001 From: hniksic Date: Mon, 15 Apr 2002 18:13:51 -0700 Subject: [PATCH] [svn] If content-type is not given, assume text/html. --- src/ChangeLog | 5 +++++ src/http.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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))