commit f73d9d09c7ad03704b000b5cccf64f1398b84788
parent 5ff7ffdffe25acaf7eea9b9a60daf0bb50d084ab
Author: ukai <ukai>
Date: Thu, 26 Dec 2002 15:23:20 +0000
[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>
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git 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
diff --git a/file.c b/file.c
@@ -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