bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38713: 27.0.50; eww doesn't handle protocols other than https?


From: Juri Linkov
Subject: bug#38713: 27.0.50; eww doesn't handle protocols other than https?
Date: Mon, 23 Dec 2019 01:11:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

0. emacs -Q
1. M-x eww RET about:protocols RET hangs with the following line:

Loading http://about:protocols/...

whereas after applying the following patch it displays the nicely
formatted HTML page:

  Supported Protocols - URL vEmacs
   Protocol   Properties   Description
   about   Synchronous  N/A
     Default Port: 0
   ...

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index dccaf0497f..64386921c7 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -319,7 +319,8 @@ eww--dwim-expand-url
         (t
         ;; Anything that starts with something that vaguely looks
         ;; like a protocol designator is interpreted as a full URL.
-         (if (or (string-match "\\`[A-Za-z]+:" url)
+         (unless (string-match-p "\\`about:" url)
+         (if (or (string-match-p "\\`[A-Za-z]+:" url)
                 ;; Also try to match "naked" URLs like
                 ;; en.wikipedia.org/wiki/Free software
                 (string-match "\\`[A-Za-z_]+\\.[A-Za-z._]+/" url)
@@ -335,7 +336,7 @@ eww--dwim-expand-url
                  (setq url (concat url "/"))))
            (setq url (concat eww-search-prefix
                              (mapconcat
-                              #'url-hexify-string (split-string url) "+"))))))
+                              #'url-hexify-string (split-string url) "+")))))))
   url)
 
 (defun eww--preprocess-html (start end)
diff --git a/lisp/url/url-about.el b/lisp/url/url-about.el
index e9d9d6346e..ee79ee1aab 100644
--- a/lisp/url/url-about.el
+++ b/lisp/url/url-about.el
@@ -91,7 +95,7 @@ url-about
     (if (fboundp func)
        (progn
          (set-buffer (generate-new-buffer " *about-data*"))
-         (insert "Content-type: text/plain\n\n")
+         (insert "Content-type: text/html\n\n")
          (funcall func url)
          (current-buffer))
       (error "URL does not know about `%s'" item))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]