[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 75f1882: Convert the remaining strings to unibyte
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] emacs-25 75f1882: Convert the remaining strings to unibyte before concatenating |
Date: |
Thu, 11 Aug 2016 18:06:55 +0000 (UTC) |
branch: emacs-25
commit 75f1882479cc62f8795bb652a0853a3f395420a2
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Convert the remaining strings to unibyte before concatenating
* lisp/url/url-http.el (url-http--encode-string): New function.
(url-http-create-request): Use it to convert ASCII to unibyte.
(Bug#24117)
---
lisp/url/url-http.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 7156e6f..860e652 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -235,7 +235,7 @@ request.")
'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
@@ -278,7 +278,8 @@ request.")
(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"
@@ -360,6 +361,11 @@ request.")
(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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 75f1882: Convert the remaining strings to unibyte before concatenating,
Dmitry Gutov <=