[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url b4ee883 4/7: Get the HTML redirect right
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url b4ee883 4/7: Get the HTML redirect right (for duck duck go). |
Date: |
Sat, 21 Jan 2017 23:08:22 +0000 (UTC) |
branch: scratch/with-url
commit b4ee883cd7c609d2e4afd17e240b0c264399a1b3
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Get the HTML redirect right (for duck duck go).
---
lisp/net/eww.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 46f16a8..85d7a8d 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -283,7 +283,7 @@ word(s) will be searched for via `eww-search-prefix'."
(eww-setup-buffer)
(eww--fetch-url url))
-(cl-defun eww--fetch-url (url &key method data)
+(cl-defun eww--fetch-url (url &key (method "GET") data)
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
;; there may be funny business going on.
@@ -357,11 +357,12 @@ Currently this means either text/html or
application/xhtml+xml."
(cond
((url-errorp)
(with-current-buffer buffer
- (erase-buffer)
- (insert (format "Error when fetching %s:\n%s %s\n"
- url (car (url-status 'response))
- (cadr (url-status 'response))))
- (goto-char (point-min))))
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert (format "Error when fetching '%s':\n%s %s\n"
+ url (car (url-status 'response))
+ (cadr (url-status 'response))))
+ (goto-char (point-min)))))
((and eww-use-external-browser-for-content-type
(string-match-p eww-use-external-browser-for-content-type
(car content-type)))
@@ -490,7 +491,7 @@ Currently this means either text/html or
application/xhtml+xml."
(when (and (cl-equalp (dom-attr dom 'http-equiv) "refresh")
(< eww-redirect-level 5))
(when-let (refresh (dom-attr dom 'content))
- (when (or (string-match "^\\([0-9]+\\) *;.*url=\"\\([^\"]+\\)\"" refresh)
+ (when (or (string-match "^\\([0-9]+\\) *;.*url=[\"']\\([^\"']+\\)[\"']"
refresh)
(string-match "^\\([0-9]+\\) *;.*url=\\([^ ]+\\)" refresh))
(let ((timeout (match-string 1 refresh))
(url (match-string 2 refresh))
- [Emacs-diffs] scratch/with-url updated (7355274 -> f74e07b), Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url b4ee883 4/7: Get the HTML redirect right (for duck duck go).,
Lars Ingebrigtsen <=
- [Emacs-diffs] scratch/with-url 954aecf 2/7: Actually send over the HTTP headers, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url f74e07b 7/7: Get the "peer closes connection first" case right, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url e331a03 6/7: Remove debugging, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 94b1d02 3/7: Decompress compressed data, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 2ca3815 1/7: Convert to with-url, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 41f9cda 5/7: Allow a global debugging switch for easier debugging, Lars Ingebrigtsen, 2017/01/21