gateway: allow more gateway versions

This commit is contained in:
Luna 2021-06-25 16:22:43 -03:00
parent 106caea671
commit a65f9a9565
1 changed files with 3 additions and 3 deletions

View File

@ -38,11 +38,11 @@ async def websocket_handler(app, ws, url):
except (KeyError, IndexError): except (KeyError, IndexError):
gw_encoding = "json" gw_encoding = "json"
if gw_version not in ("6", "7"): if gw_version not in ("6", "7", "8", "9"):
return await ws.close(1000, "Invalid gateway version") return await ws.close(4000, f"Invalid gateway version (got {gw_version})")
if gw_encoding not in ("json", "etf"): if gw_encoding not in ("json", "etf"):
return await ws.close(1000, "Invalid gateway encoding") return await ws.close(4000, f"Invalid gateway encoding (got {gw_encoding})")
try: try:
gw_compress: Optional[str] = args["compress"][0] gw_compress: Optional[str] = args["compress"][0]