summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/url/url-http.el6
-rw-r--r--lisp/url/url-util.el2
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 916f263e4fe..258f8025662 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 e011b96ada2..54b02e98c97 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)))