[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Content-Type ignored if 404 Not Found



In [emacs-w3m : No.11646] jidanni@xxxxxxxxxxx wrote:
> Images like

> $ HEAD http://i.ytimg.com/vi/zzzzzz/hq3.jpg
> 404 Not Found
> Content-Type: image/jpeg
> ...

> Cannot be viewed properly, as their Content-Type gets ignored due to
> being 404.

> They cannot be viewed properly alone, or embedded in other pages.
> emacs-w3m-version "1.4.442"

Well, I'm not quite sure of it but decoding such contents might
be worth trying.  The attached patch doesn't seem to make emacs-w3m
cause any harm, at least for hq3.jpg and non-existent urls.  Anyone?
--- w3m.el~	2011-09-07 23:15:48.000000000 +0000
+++ w3m.el	2011-09-30 04:52:09.406250000 +0000
@@ -5545,7 +5545,7 @@
 	   ((eq attr 'redirection-exceeded)
 	    "X-w3m-error/redirection")
 	   ((or (not (string-match "\\`https?:" url))
-		(memq (car attr) '(200 300)))
+		(memq (car attr) '(200 300 404)))
 	    (if (or no-uncompress
 		    (w3m-decode-encoded-contents (nth 4 attr)))
 		(let ((temp-buffer (current-buffer)))