]> code.delx.au - gnu-emacs/blobdiff - lisp/url/url-http.el
Merge emacs-25 into master (using imerge)
[gnu-emacs] / lisp / url / url-http.el
index e34f352e11d36a9381e9fbbcadc2bf4e47bd7258..36cc2f32bbcd3be3aba4c89076c6fc71921b897d 100644 (file)
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'cl-lib)
+(require 'puny)
 (eval-when-compile
   (require 'subr-x))
 
@@ -307,8 +308,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
@@ -1195,17 +1197,20 @@ the end of the document."
   "Retrieve URL via HTTP asynchronously.
 URL must be a parsed URL.  See `url-generic-parse-url' for details.
 
-When retrieval is completed, execute the function CALLBACK, passing it
-an updated value of CBARGS as arguments.  The first element in CBARGS
-should be a plist describing what has happened so far during the
-request, as described in the docstring of `url-retrieve' (if in
-doubt, specify nil).
+When retrieval is completed, execute the function CALLBACK,
+passing it an updated value of CBARGS as arguments.  The first
+element in CBARGS should be a plist describing what has happened
+so far during the request, as described in the docstring of
+`url-retrieve' (if in doubt, specify nil).  The current buffer
+then CALLBACK is executed is the retrieval buffer.
 
 Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
 previous `url-http' call, which is being re-attempted.
 
 Optional arg GATEWAY-METHOD specifies the gateway to be used,
-overriding the value of `url-gateway-method'."
+overriding the value of `url-gateway-method'.
+
+The return value of this function is the retrieval buffer."
   (cl-check-type url vector "Need a pre-parsed URL.")
   (let* ((host (url-host (or url-using-proxy url)))
         (port (url-port (or url-using-proxy url)))