[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
send
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."
accept-string
(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))))
- (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"
accept-regexp)
+ (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))
- [elpa] externals/websocket 2aad0b2 03/16: Upgrade to version 1.3., (continued)
- [elpa] externals/websocket 2aad0b2 03/16: Upgrade to version 1.3., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 50d62ac 05/16: Add ability to handle cookies., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 6872e74 06/16: Fix maintainer address, Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 6fa9830 07/16: Version 1.6, mostly fixes for fragmented headers., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 3b21915 10/16: Update to emacs-websocket version 1.8., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket ba4334b 11/16: Remove use of string-make-unibyte and other cleanups., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 65b3e1c 12/16: Port websocket to bleeding-edge 32-bit Emacs, Stefan Monnier, 2020/11/27
- [elpa] externals/websocket bc57ded 15/16: Upgrade websocket library to version 1.11.1., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket 8d540d4 13/16: websocket: Version 1.9, custom header support., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket c4d8d58 14/16: Fix confusing documentation string in websocket library., Stefan Monnier, 2020/11/27
- [elpa] externals/websocket f11d03a 16/16: Allow websocket accept header variants.,
Stefan Monnier <=