From 492a4dae34428933b162a5579c2a7c4e14696a59 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Fri, 21 Aug 2020 03:00:04 +0200 Subject: [PATCH] By default, websockets paths start with `ws/`. --- src/websocketd.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/websocketd.cr b/src/websocketd.cr index 53c258b..9a407d6 100644 --- a/src/websocketd.cr +++ b/src/websocketd.cr @@ -99,7 +99,7 @@ def ws_http_upgrade(client) headers = headers.map { |key, value| "#{key}: #{value[0]}\r\n" }.join # requested service, fd - req_service = request.path.lchop + req_service = request.path.lchop.sub "ws/", "" if req_service.ends_with? ".JSON" Context.context.is_json[client.fd] = true