aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-12-26 15:23:20 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-12-26 15:23:20 +0000
commit4db6add6837769c73b7934edcaf5ff3e1589a695 (patch)
treeeca68f21c7de1bd7ff930fcf653950b2c3cf18b8
parentfix indent (diff)
downloadw3m-4db6add6837769c73b7934edcaf5ff3e1589a695.tar.gz
w3m-4db6add6837769c73b7934edcaf5ff3e1589a695.zip
[w3m-dev 03604] http response code and content-type
* file.c (loadGeneralFile): don't guessContentType if http errors From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r--ChangeLog7
-rw-r--r--file.c9
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ca00ba..e21e572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 03604] http response code and content-type
+ * file.c (loadGeneralFile): don't guessContentType if http errors
+
2002-12-26 Hiroyuki Ito <hito@crl.go.jp>
* [w3m-dev 03602] Re: w3mimgdisplay core dump
@@ -6086,4 +6091,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.648 2002/12/25 16:14:45 ukai Exp $
+$Id: ChangeLog,v 1.649 2002/12/26 15:23:20 ukai Exp $
diff --git a/file.c b/file.c
index 5326f4b..b150cf9 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.169 2002/12/24 17:20:46 ukai Exp $ */
+/* $Id: file.c,v 1.170 2002/12/26 15:23:22 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -1659,8 +1659,11 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
#endif
readHeader(&f, t_buf, FALSE, &pu);
t = checkContentType(t_buf);
- if (t == NULL && pu.file != NULL)
- t = guessContentType(pu.file);
+ if (t == NULL && pu.file != NULL) {
+ if (!((http_response_code >= 400 && http_response_code <= 407) ||
+ (http_response_code >= 500 && http_response_code <= 505)))
+ t = guessContentType(pu.file);
+ }
if (t == NULL)
t = "text/plain";
if (http_response_code >= 301 && http_response_code <= 303