diff options
author | Federico Tedin <federicotedin@gmail.com> | 2019-05-13 14:06:16 -0400 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-05-13 14:06:16 -0400 |
commit | 81af228a63c6ca284ae9fc1647615842c03d7881 (patch) | |
tree | aa3d8ead91956ef424eacbde20aa6fd35b1b4b11 /lisp/net | |
parent | d2d4916046e31e46598f0a0edbc65e75b8cb4cc3 (diff) | |
download | emacs-81af228a63c6ca284ae9fc1647615842c03d7881.tar.gz |
Use a more specific Accepts header in eww
* lisp/net/eww.el (eww-accept-content-types): New variable.
(eww): Use it.
(eww-reload): Use it. (bug#33002).
Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/eww.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index d9ac3e1ff5c..63afe11f053 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -223,6 +223,10 @@ See also `eww-form-checkbox-selected-symbol'." (defvar eww-local-regex "localhost" "When this regex is found in the URL, it's not a keyword but an address.") +(defvar eww-accept-content-types + "text/html, text/plain, text/sgml, text/css, application/xhtml+xml, */*;q=0.01" + "Value used for the HTTP 'Accept' header.") + (defvar eww-link-keymap (let ((map (copy-keymap shr-map))) (define-key map "\r" 'eww-follow-link) @@ -290,8 +294,9 @@ the default EWW buffer." (let ((inhibit-read-only t)) (insert (format "Loading %s..." url)) (goto-char (point-min))) - (url-retrieve url 'eww-render - (list url nil (current-buffer)))) + (let ((url-mime-accept-string eww-accept-content-types)) + (url-retrieve url 'eww-render + (list url nil (current-buffer))))) (defun eww--dwim-expand-url (url) (setq url (string-trim url)) @@ -952,8 +957,9 @@ just re-display the HTML already fetched." (error "No current HTML data") (eww-display-html 'utf-8 url (plist-get eww-data :dom) (point) (current-buffer))) - (url-retrieve url 'eww-render - (list url (point) (current-buffer) encode))))) + (let ((url-mime-accept-string eww-accept-content-types)) + (url-retrieve url 'eww-render + (list url (point) (current-buffer) encode)))))) ;; Form support. |