* 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.
;;; Code:
(require 'cl-lib)
+(require 'puny)
(eval-when-compile
(require 'subr-x))
(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
(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)))