summaryrefslogtreecommitdiff
path: root/lisp/url/url-http.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-08-22 14:38:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-08-22 14:38:49 -0700
commit590dab5a68f4283d53ce79d4633fe1503131baea (patch)
tree2e2452d22d54826cb84e2c5dc976abbb2ed40322 /lisp/url/url-http.el
parentcaa2770d1d79f9c8013d6dddcd9e86d05230b26d (diff)
parent8c2946e29b38fa3e0dff6b4d402ba0fda0e03c9b (diff)
downloademacs-590dab5a68f4283d53ce79d4633fe1503131baea.tar.gz
Merge from origin/emacs-25
8c2946e In NEWS describe new handling of window margins (Bug#24193) 0cee66c Facultatively ignore margins when splitting and resizing wind... 8d68147 Document CATEGORY arg to modify-category-entry 8342e74 Document char-script-table's effect on word motion e9ff485 Further fix for 'url-http-create-request' and multibyte strings 0695235 Fix docstring of eval-expression 98b01dd Clarify when 'cursor' property is in effect 75f1882 Convert the remaining strings to unibyte before concatenating d2db5dd Fix bug with handling the bidi cache ccd0e92 * doc/lispref/text.texi (Change Hooks): Minor copyedits. f785ff4 Clarify documentation of before/after-change-functions 3c9cb57 Document use of vectors in keymaps # Conflicts: # src/xdisp.c
Diffstat (limited to 'lisp/url/url-http.el')
-rw-r--r--lisp/url/url-http.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index ef7b77969e6..f62ec57f53e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -267,7 +267,7 @@ The string is based on `url-privacy-level' and `url-user-agent'."
'url-http-proxy-basic-auth-storage))
(url-get-authentication url-http-proxy nil 'any nil))))
(real-fname (url-filename url-http-target-url))
- (host (url-host url-http-target-url))
+ (host (url-http--encode-string (url-host url-http-target-url)))
(auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers))
nil
(url-get-authentication (or
@@ -310,7 +310,8 @@ The string is based on `url-privacy-level' and `url-user-agent'."
(concat
;; The request
(or url-http-method "GET") " "
- (if using-proxy (url-recreate-url url-http-target-url) real-fname)
+ (url-http--encode-string
+ (if using-proxy (url-recreate-url url-http-target-url) real-fname))
" HTTP/" url-http-version "\r\n"
;; Version of MIME we speak
"MIME-Version: 1.0\r\n"
@@ -347,7 +348,9 @@ The string is based on `url-privacy-level' and `url-user-agent'."
"Accept-encoding: " url-mime-encoding-string "\r\n"))
(if url-mime-charset-string
(concat
- "Accept-charset: " url-mime-charset-string "\r\n"))
+ "Accept-charset: "
+ (url-http--encode-string url-mime-charset-string)
+ "\r\n"))
;; Languages we understand
(if url-mime-language-string
(concat
@@ -393,6 +396,11 @@ The string is based on `url-privacy-level' and `url-user-agent'."
(url-http-debug "Request is: \n%s" request)
request))
+(defun url-http--encode-string (s)
+ (if (multibyte-string-p s)
+ (encode-coding-string s 'us-ascii)
+ s))
+
;; Parsing routines
(defun url-http-clean-headers ()
"Remove trailing \r from header lines.