[Top][All Lists]

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

[elpa] externals/websocket f11d03a 16/16: Allow websocket accept header

From: Stefan Monnier
Subject: [elpa] externals/websocket f11d03a 16/16: Allow websocket accept header variants.
Date: Fri, 27 Nov 2020 17:47:20 -0500 (EST)

branch: externals/websocket
commit f11d03a3b85c4912fd6c02904ffe4a82237e27e7
Author: Andrew Hyatt <ahyatt@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Allow websocket accept header variants.
    * packages/websocket/websocket.el (websocket-verify-headers): Some clients 
       the alternate capitalization Sec-Websocket-Accept, so accept this 
alternate version.
 websocket.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/websocket.el b/websocket.el
index 68e847c..1d69508 100644
--- a/websocket.el
+++ b/websocket.el
@@ -4,7 +4,7 @@
 ;; Author: Andrew Hyatt <ahyatt@gmail.com>
 ;; Keywords: Communication, Websocket, Server
-;; Version: 1.11.1
+;; Version: 1.12
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; This program is free software; you can redistribute it and/or
@@ -100,7 +100,7 @@ same for the protocols."
   (inflight-input nil))
-(defvar websocket-version "1.11.1"
+(defvar websocket-version "1.12"
   "Version numbers of this version of websocket.el.")
 (defvar websocket-debug nil
@@ -797,10 +797,10 @@ connection is invalid, the connection will be closed."
 The output is assumed to have complete headers.  This function
 will either return t or call `error'.  This has the side-effect
 of populating the list of server extensions to WEBSOCKET."
-  (let ((accept-string
-         (concat "Sec-WebSocket-Accept: " (websocket-accept-string 
-    (websocket-debug websocket "Checking for accept header: %s" accept-string)
-    (unless (string-match (regexp-quote accept-string) output)
+  (let ((accept-regexp
+         (concat "Sec-Web[Ss]ocket-Accept: " (regexp-quote 
(websocket-accept-string websocket)))))
+    (websocket-debug websocket "Checking for accept header regexp: %s" 
+    (unless (string-match accept-regexp output)
       (signal 'websocket-invalid-header
               (list "Incorrect handshake from websocket: is this really a 
websocket connection?"))))
   (let ((case-fold-search t))

reply via email to

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