diff options
author | Jan Nieuwenhuizen <janneke@gnu.org> | 2019-04-22 17:03:45 +0200 |
---|---|---|
committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2019-04-22 20:08:36 +0200 |
commit | ff48f246f69529102b497dc1de627b8a70f7218f (patch) | |
tree | 3d2724872d01941dba6d75e558d56c06bff124ba | |
parent | c344305a29e610685dd2c2746bb495295f1696ef (diff) | |
download | 8sync-ff48f246f69529102b497dc1de627b8a70f7218f.tar.gz |
web server: Treat upgrade requests as case-insensitive.
* 8sync/systems/web.scm (maybe-upgrade-request): Compare using
string-ci=? Fixes upgrade request for "WebSocket".
-rw-r--r-- | 8sync/systems/web.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/8sync/systems/web.scm b/8sync/systems/web.scm index a6ee696..7381f14 100644 --- a/8sync/systems/web.scm +++ b/8sync/systems/web.scm @@ -1,5 +1,6 @@ ;;; 8sync --- Asynchronous programming for Guile ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org> +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; ;;; Code (also under the LGPL) borrowed from fibers: ;;; Copyright © 2016 Andy Wingo <wingo@pobox.com> @@ -32,6 +33,7 @@ #:use-module (web server) #:use-module (rnrs io ports) #:use-module (8sync) + #:use-module ((srfi srfi-1) #:select (assoc)) #:export (<web-server> ;; @@: If we don't want to import these because of ;; "conflicts" with other objects, we could just @@ -149,7 +151,7 @@ as we're alive." (let loop ((upgrades (request-upgrade request))) (if (eq? upgrades '()) #f ; Shouldn't upgrade - (match (assoc (car upgrades) upgrade-paths) + (match (assoc (car upgrades) upgrade-paths string-ci=?) ;; Yes, upgrade with this method ((_ . upgrade-proc) upgrade-proc) |