[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 8b61c22 5/6: IDNA-related fixes for the URL library
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 8b61c22 5/6: IDNA-related fixes for the URL library |
Date: |
Mon, 28 Dec 2015 23:11:55 +0000 |
branch: master
commit 8b61c22ea1a53167dae2e39eb318ceeb326cdff5
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
IDNA-related fixes for the URL library
* lisp/url/url-http.el (url-http-create-request): IDNA-encode
the Host: header.
* lisp/url/url-util.el (url-encode-url): Don't hex-encode
domain names, but leave them as UTF-8, so that they can be
IDNA-encoded later when contacting the host.
---
lisp/url/url-http.el | 6 ++++--
lisp/url/url-util.el | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 916f263..258f802 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -26,6 +26,7 @@
;;; Code:
(require 'cl-lib)
+(require 'puny)
(eval-when-compile
(require 'subr-x))
@@ -318,8 +319,9 @@ request.")
(url-scheme-get-property
(url-type url-http-target-url) 'default-port))
(format
- "Host: %s:%d\r\n" host (url-port url-http-target-url))
- (format "Host: %s\r\n" host))
+ "Host: %s:%d\r\n" (puny-encode-domain host)
+ (url-port url-http-target-url))
+ (format "Host: %s\r\n" (puny-encode-domain host)))
;; Who its from
(if url-personal-mail-address
(concat
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index e011b96..54b02e9 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -468,7 +468,7 @@ should return it unchanged."
(and host
(not (string-match "\\`\\[.*\\]\\'" host))
(setf (url-host obj)
- (url-hexify-string host url-host-allowed-chars)))
+ (decode-coding-string (url-host obj) 'utf-8)))
(if path
(setq path (url-hexify-string path url-path-allowed-chars)))
- [Emacs-diffs] master updated (0e99ccb -> 5fcbeaf), Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 1efc5f8 2/6: shr link traversal fixup, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master fc3965e 4/6: IDNA-encode all domain names in `open-network-stream', Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 5fcbeaf 6/6: Mention the new puny.el library, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master d686802 1/6: Reconnect erc even on server errors, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 341feb3 3/6: Fix puny-encoding all-non-ASCII domains, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 8b61c22 5/6: IDNA-related fixes for the URL library,
Lars Ingebrigtsen <=