emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] url: Wrap cookie headers in url-http--encode-string.


From: Toke Høiland-Jørgensen
Subject: [PATCH] url: Wrap cookie headers in url-http--encode-string.
Date: Wed, 7 Sep 2016 17:30:14 +0200

In some cases the output of url-cookie-generate-header can be multibyte,
which will trip the length check that was added at the end of
url-http-create-request. This seems to happen only when there's a
request body which contains UTF-8-encoded non-ASCII characters.

Signed-off-by: Toke Høiland-Jørgensen <address@hidden>
---
 lisp/url/url-http.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 927d0bb..81bb9b4 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -366,9 +366,10 @@ The string is based on `url-privacy-level' and 
`url-user-agent'."
              auth
              ;; Cookies
             (when (url-use-cookies url-http-target-url)
-              (url-cookie-generate-header-lines
-               host real-fname
-               (equal "https" (url-type url-http-target-url))))
+               (url-http--encode-string
+                (url-cookie-generate-header-lines
+                 host real-fname
+                 (equal "https" (url-type url-http-target-url)))))
              ;; If-modified-since
              (if (and (not no-cache)
                       (member url-http-method '("GET" nil)))
-- 
2.9.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]