Ver código fonte

Make roomcode case insensitive

niels 4 anos atrás
pai
commit
97eae8401a
2 arquivos alterados com 4 adições e 3 exclusões
  1. 1 0
      chube.py
  2. 3 3
      chube_ws.py

+ 1 - 0
chube.py

@@ -1,3 +1,4 @@
+import re
 from threading import RLock
 from typing import Optional, Iterator, Dict, List
 

+ 3 - 3
chube_ws.py

@@ -47,14 +47,14 @@ class Resolver:
                 await on_close(websocket, path)
 
         async def handler(websocket, path):
-            await on_open_handler(websocket, path)
+            await on_open_handler(websocket, path.lower())
             try:
                 while True:
                     message = await websocket.recv()
                     processor, body = self.resolve(message)
-                    await processor(websocket, body, path)
+                    await processor(websocket, body, path.lower())
             except websockets.ConnectionClosed:
-                await on_close_handler(websocket, path)
+                await on_close_handler(websocket, path.lower())
 
         return handler