emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/websocket 058e8f4696 059/114: Fix issue with missing \r


From: ELPA Syncer
Subject: [elpa] externals/websocket 058e8f4696 059/114: Fix issue with missing \r\n when using custom headers.
Date: Wed, 15 Feb 2023 20:59:00 -0500 (EST)

branch: externals/websocket
commit 058e8f46962f99b5c63824aec99ad81b295f1a7b
Author: Andrew Hyatt <ahyatt@gmail.com>
Commit: Andrew Hyatt <ahyatt@gmail.com>

    Fix issue with missing \r\n when using custom headers.
---
 websocket-test.el | 2 +-
 websocket.el      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/websocket-test.el b/websocket-test.el
index 772477b804..cfb2db00fd 100644
--- a/websocket-test.el
+++ b/websocket-test.el
@@ -220,7 +220,7 @@
                                          '(("ext1" . ("a" "b=2"))
                                            ("ext2")) nil)))
       (should (equal
-               (concat base-headers "Foo: bar\r\nBaz: boo\r\n")
+               (concat base-headers "Foo: bar\r\nBaz: boo\r\n\r\n")
                (websocket-create-headers "ws://www.example.com/path"
                                          "key" nil nil '(("Foo" . "bar") 
("Baz" . "boo"))))))
     (flet ((url-cookie-generate-header-lines
diff --git a/websocket.el b/websocket.el
index a98344b3a8..f175bf623d 100644
--- a/websocket.el
+++ b/websocket.el
@@ -947,8 +947,9 @@ All these parameters are defined as in `websocket-open'."
                                     (mapconcat 'identity (cdr ext) "; "))))
                                extensions ", ")))
                     (when cookie-header cookie-header)
-                    (mapconcat (lambda (cons) (format "%s: %s" (car cons) (cdr 
cons)))
-                               custom-headers-alist "\r\n")
+                    (concat (mapconcat (lambda (cons) (format "%s: %s" (car 
cons) (cdr cons)))
+                                       custom-headers-alist "\r\n")
+                            (when custom-headers-alist "\r\n"))
                     "\r\n")
             host-port
             key



reply via email to

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